Link to home
Start Free TrialLog in
Avatar of skin
skin

asked on

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?
Avatar of Mirkwood
Mirkwood

Note that a boolean in C++ uses values 1 and 0. While in VB it uses -1 and 0.
ASKER CERTIFIED SOLUTION
Avatar of Mirkwood
Mirkwood

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skin

ASKER

My experience is that ByRef only works for variants in VB Script