Could anyone give me a hand in understanding what I'm doing wrong in the following part of code, written in C++?
The matter is that during the execution the line of code "pCommandGroup->Activate(&vbResult);" causes a crash.
extern "C" void __declspec (dllexport) Test_command()
extern "C" int __declspec (dllexport) OnUpdateTest()
HRESULT MyAddIn::ConnectToSW(LPDISPATCH ThisSW,long Cookie,VARIANT_BOOL *IsConnected)
CComQIPtr <ISldWorks> pSldWorks=ThisSW;
CComPtr <ICommandManager> pCommandManager;
CComPtr <ICommandGroup> pCommandGroup;
pCommandGroup->Activate(&vbResult); // It crashes during the exacution
My assumption is that could be due to incorrect siganure for the callbacks in the method ICommandGroup::AddCommandItem2. As a matter of fact, if I put there empty strings for the callbacks like this
the crash doesn't occur.
Unfortunately, all samples how to use this function are only available for C# and VB.
Thank you for any assistance!