you forgot the call to ISwAddin::SetAddinCallbackInfo2. This method provides the information about the menu callback functions, so Solidworks will know about function entries. Moreover set callback functions "more COM compliant" returning an HRESULT value:
For "enabled method" use an out parameter to enable / disable the attached command:
STDMETHOD (OnUpdateTest)(long* status);
Don't forget to expose from your COM object the IDispatch interface: I use ATL so, COM_INTERFACE_ENTRY(IDispatch).
I hope this help you.
Thanks a lot for your reply!
A long time passed since I asked my question.
After struggling for a while with the problem I noticed by myself that I forgot to call ISwAddin::SetAddinCallbackInfo2.
After I corrected the mistake my code stopped to crash but unfortunately it still didn't work as it was expected.
I provided my own implementation of IDispatch interface to pass it to ISwAddin::SetAddinCallbackInfo2 that should handle the callbacks but for some reason SolidWorks didn't even try to call any of its method (neither IDispatch::Invoke, nor IDispatch::GetIDsOfNames, nor anything else). Actually only one method IUnknown::QueryInterface was called but it didn't ask for any special interface that was not supported.
After fighting for some time with that strange behavior and having no success I decided to write a small application in C# that should handle the creation of Command Manager tabs (that was my initial goal) and dispatch callbacks to my C++ module. Not hard to guess that code written in C# began to work just fine!
Well, for me that was enough. Unfortunately I didn't understand what was wrong in the same thing written in C++.