Problem with CreateLine

CComPtr< ISketchManager> iSwSketchMgr;

hr = iSwModel->get_SketchManager(&iSwSketchMgr);

ASSERT(S_OK == hr);

ASSERT(NULL != iSwSketchMgr);

CComPtr iSwSketchSeg;

hr = iSwSketchMgr->CreateLine(0.0, 0.0, 0.0,1.0,1.0,1.0,&iSwSketchSeg);

hr always return false and iSwSketchSeg is always null. Do I have to add something before using the CreateLine function? Thanks!

SolidworksApi macros