ShapeBuffer.cpp in the samples/ShapeBuffer directory of the API seems to provide an example of what's necessary. You can roll your own helper functions, but either way, it's probably wise to review the shapefile reference PDFs in the doc directory.
i saw the samples in the ShapeBuffer.cpp, but it's not quite what i am looking for. Can you please provide some code example to a transform between runtime objects, such as polyline to shapebuffer?
Between LineGeomTest and LineZGeomTest, it looks like the bases are covered -- conversion in both directions, with multiple dimensions -- what more do you need?
Perhaps it will help if you think of it as a "packing" exercise, instead of transformation.
It is not necessary to convert your PolyLine shape buffer to a ShapeBuffer because it already is one.
ShapeBuffer is the base class for all of the other shape buffer types. Since SetGeometry accepts a ShapeBuffer object, that means you can pass an instance of the base class or any of the derived classes. This is a fundamental object oriented programming technique of C++.
Here is a small extract from the ShapeBuffer sample program: