ActiveX Control Events ByRef Parm doesn't return in VBScript

I have a ActiveX Control written in VC that fires a MyContextMenu event:
ContextMenu(VARIANT pIContextMenu, short x, short y, long dwReserved, boolean* bHandled);
The problem is with the last parameter bHandled.  If this returns TRUE it doesn't display my context menu.  The problem is that from VB Script this parameter value doesn't get set to the value in the following VB Script code:
Sub MyComponent_MyContextMenu(ByVal pIContextMenu, ByVal x, ByVal y, ByVal dwReserved, ByRef bHandled)
    bHandled = True
End Sub

This same code in VB works fine.
Any ideas?
skinAsked:
Who is Participating?
 
MirkwoodConnect With a Mentor Commented:
Note that a boolean in C++ uses values 1 and 0. While in VB it uses -1 and 0.
0
 
MirkwoodCommented:
Note that a boolean in C++ uses values 1 and 0. While in VB it uses -1 and 0.
0
 
skinAuthor Commented:
My experience is that ByRef only works for variants in VB Script
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.