// Create the point implementation
CAAOmtPoint* pNewPoint = new CAAOmtPoint(iX, iY);
if(!pNewPoint) {
cout << "CreatePoint(): could not create a CAAOmtPoint" << endl << flush;
return NULL;
}
// Get a CATIPoint on pNewPoint
rc = pNewPoint->QueryInterface(IID_CAAIPoint,
(void**) opiNewCAAIPoint);
if(FAILED(rc)) {
cout << "CreatePoint(): could not obtaine CAAIPoint interface" << endl << flush;
return E_FAIL;
}
pNewPoint->Release();
pNewPoint=NULL;
cout << "I Got a Point...." << endl << flush;
return S_OK;
}
我在使用时,是这样的:
CAAOmtModelFactory * pCreatePointFactory;
pCreatePointFactory =(CAAOmtModelFactory *) new CAAOmtModelFactory();