borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (MultiLine in TextBox) New Topic New Poll Post Reply
AndreaVB Forum : ActiveX : VB PopupMenu Problem with ActiveX
Poster Message
Andy214
Level: Trainee

Registered: 26-12-2003
Posts: 3

icon 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-

29-09-2005 at 08:08 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1060
icon Re: VB PopupMenu Problem with ActiveX

Hi,
This is not really a resolution (will think about a proper one), but look at www.vbaccelerator.com for their cpopupmenu component. It is a standalone component for just this situation and you may find it useful.
As I said, i'll investigate ways to pass menus to an activex control too
Hope this helps,
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

19-10-2005 at 10:23 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : ActiveX : VB PopupMenu Problem with ActiveX
Next Topic (MultiLine in TextBox) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder