Retrieve the Menu command Id
Example code
BSTR bstrMenuString; long lComdId; CComPtr<IISmpCommands>m_IISMPCommands; HRESULT hr; hr=m_IISMPCommands.CoCreateInstance(CLSID_ISmpCommands); if(FAILED(hr)) { AfxMessageBox(_T("IISmpCommandsInterface initialisation failed")); return FALSE; } m_IISMPCommands->get_MenuCommandID(m_lSessionID,bstrMenuString,&lComdId);