Allows access to all exposed interfaces in the DraftSight API.
The following code snippets show how to get the IApplication object:
COM native C++
public:
CComQIPtr<IApplication> m_DsApp;
public:
STDMETHOD(ConnectToDraftSight)(LPDISPATCH DsApp, long Cookie, VARIANT_BOOL * IsConnected)
{
m_DsApp = DsApp;
IUnknown* dsUnk = NULL ;
HRESULT hr = DsApp->QueryInterface(IID_IUnknown, (void **) &dsUnk)
}
C++
myApplication *myApp = NULL;
const dsString myApplication::appID = L"Replace_with_add-in's_GUID";
#ifdef DS_WIN
DSADDINSAMPLE_EXPORT bool connectToDraftSight(int cookie, dsApplication_c *dsApp)
#else //DS_WIN
extern "C" DSADDINSAMPLE_EXPORT bool connectToDraftSight(int cookie, dsApplication_c *dsApp)
#endif //DS_WIN
{
if ( myApp == NULL )
{
myApp = new myApplication(dsApp);
myApp->CreateUserInterfaceAndCommands();
return true;
}
return false;
}
Back to top