Jump to content

Contacts Menu Integration Problem


Guest zero_divide_1

Recommended Posts

Guest zero_divide_1

Hello all,

I'm currently in a quandry with a plugin I'm currently writing. I'm using Visual Studio 2005, and I've been developing a plugin in C++ based on the MedicalHistory example provided with the WM5 PPC SDK. Unfortunately, I've been running into a bit of a problem with the plugin I've written and the MedicalHistory plugin, as well as a few other plugins. What is happening is whenever I have both plugins registered, I see both show up in the context menu of the Contacts application, so that part of it is working, but then when I click on them, depending on the order I installed them, either the MedicalHistory plugin will load up on both menu items, or my plugin will load up on each one. In other words, each menu item should correspond to a different plugin (Medical History or my plugin), but they both load the same plugin when you click either one. Here is the code that I have implemented in my plugin (I've noticed this problem with other plugins I have installed on my PPC also) to add it to the menu:

HRESULT STDMETHODCALLTYPE ICFMenuExtension::QueryContextMenu(HMENU hmenu,

	UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)

{

	HRESULT hr = S_OK;

	BOOL bRet;


	m_idMenu = idCmdFirst+1;


	bRet = InsertMenu(hmenu, indexMenu, MF_BYPOSITION | MF_STRING, m_idMenu, c_szICFMenu);

	CBR(bRet);


Error:

	return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, 1);

Mind you, this is my first time writing a C++ app for WM5 and the first time using COM for a context menu extension. What am I doing wrong, if anything? Thanks in advance for all your help! :)

Link to comment
Share on other sites

Guest Raul tinca
but they both load the same plugin when you click either one. Here is the code that I have implemented in my plugin (I've noticed this problem with other plugins I have installed on my PPC also) to add it to the menu

Your code seems correct not to mention that you have the sample...:)

Check your registry entries for the menu extension entries and make sure that you use a different GUID for the 2 menu extension entries.

Cheers,

Raul Tinca

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.