Think of a CRhinoObject as a container that contains geometry, accessible by the Geometry() function. Then the geometry is returned of type ON_Geometry.

CRhinoCurveObject is a specialization of CRhinoObject, and has a new function Curve(), which returns the geometry of type ON_Curve (which is, in itself, a specialization of ON_Geometry).

Also, maybe this is known: in your first two lines you create a new object by using Duplicate(). If you do this, you must free the object when you are finished.

Due to know CRhinoObject includes ON_Geometry, I can use ON_Geometry to get ON_Curve ?

Originally, I know inherited relation, but I don’t know how to get ON_Curve.
BTW, How do you know CRhinoObject includes ON_Geometry throught inherited relation ?