I am working on an external C++ module to load SolidWorks with a specified Drawing, and then perform operations on it. A VB versoin seems to work ok, but from C++ (.net version 7.1.3088), I don't get valid returns from the OpenDoc6 call.
The symptoms I see are that SolidWorks starts (appears in Task Manager), grows somewhat in memory usage when the OpenDoc6 call is made, but then exits after a few moments. The OpenDoc6 call returns hres of S_OK, zero values in the error or warning values, and a null value for the IModelDoc2 return pointer.
Code snippet is as follows:
CoInitialize(NULL); CComPtr swApp; CComPtr swModel; HRESULT hres = swApp.CoCreateInstance(__uuidof(SldWorks), NULL, CLSCTX_LOCAL_SERVER); if (hres != S_OK) { cout