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?
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(
bHandled = True
End Sub
This same code in VB works fine.
Any ideas?
Note that a boolean in C++ uses values 1 and 0. While in VB it uses -1 and 0.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
My experience is that ByRef only works for variants in VB Script