79636391

Date: 2025-05-24 03:05:48
Score: 0.5
Natty:
Report link
CLSID clsid;
HRESULT hr = CLSIDFromProgID(L"CATIA.Application", &clsid);
CComPtr<IUnknown> pCatiaSession;
hr = GetActiveObject(clsid, NULL, &pCatiaSession);
CATIAApplication * pApp = NULL;
hr = pSession->QueryInterface(IID_CATIAApplication, (void**) &pApp);
CATIADocument * pDocument = NULL;
hr = pApp->get_ActiveDocument(pDocument);

// Get the CATDocument pointer from the CATIADocument pointer.
CATBaseUnknown * pJunk = pDocument->GetImpl();
pCATDocument = (CATDocument*)pJunk;

// Do something with the CATDocument pointer
CATDocumentServices::SaveAs(*pCATDocument, strFilePath);
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: SomeCallMeTim