Jump to content


Photo

Contacts Menu Integration Problem

- - - - -

  • Please log in to reply
1 reply to this topic

#1
zero_divide_1

zero_divide_1

    Regular

  • Members
  • PipPip
  • 74 posts
  • Devices:HTC TyTN II
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! :)

  • 0
Zero_Divide_1

Contacts Filer v1.5.9 (Requires .NET CF 2.0): [Click Here]
Read about it [Here]

Twobile (Requires .NET CF 2.0 SP1 or above): [Click here]

#2
Raul tinca

Raul tinca

    Newbie

  • Members
  • Pip
  • 26 posts
  • Devices:Hertz

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

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users