Andy214 Level: Trainee
 Registered: 26-12-2003 Posts: 3
|
VB PopupMenu Problem with ActiveX
Hi,
I have a problem dealing with PopupMenu() function... The argument 'Menu' which it requires a 'Menu' object, when is passed from an ActiveX Control Or DLL, it won't work....
It will prompt me, "Invalid Object Type; Menu Object Required".
To clarify, I went into debug mode and check it's type (TypeOf ActiveXControl.GetMenu() Is Menu), and it return TRUE.
TO further clarify, I declare a variable as 'Menu' object, and set it's reference to the ActiveXControl's Menu object, and it was successful, BUT when passed in the PopupMenu() function, it still prompts me the same error 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbmsgobjmenuctlrequired.asp
The link above provides explanation of the error message, but the object I passed in IS a Menu object... What's wrong
One wierd thing is, IF I include the ActiveX Project together as a GROUP Project, everything works fine....
At first I was using ActiveX DLL, then I tought, maybe,... MAYBE when I passed in the object, the function will do a checking/looping to check each and every control in the form if it matches and is of type Menu...
So... I convert the project to ActiveX Control (OCX) with the 'Menu' included in the OCX Control. Then in the project I include the OCX Control in the form, hoping the function PopupMenu() will now be able to find it... but same error occurs...
Any ideas anyone? Could it be, it ONLY loops the FORMS and/or OCX Controls within the project and NOT the controls inside the forms
Any help would greatly be appreciated, thanks in advance, really confused and heache with it...
____________________________
-Andy214-
|