How to set up C++ COM MenuEnableMethod for SldWorks::AddToolbarCommand2 and SldWorks::AddMenuItem2
Your function prototype must be correct for the update to be called. The method must be exposed by your COM object; it must be in the IDL file.
The following code illustrates the correct code to use:
// header file
STDMETHOD(ZoomUpdate)(long* status);
// C++ implementation file
STDMETHODIMP CSW_DWG_Editor::ZoomUpdate(long* status)
{
*status = 1;
return S_OK;
}
// IDL file
interface ISW_DWG_Editor : IDispatch
{
[id(4), helpstring("")] HRESULT ZoomUpdate([out, retval] long*
status);
}