Solved

ActiveX Control Events ByRef Parm doesn't return in VBScript

Posted on 1998-12-01
3
454 Views
Last Modified: 2012-08-13
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?
0
Comment
Question by:skin
  • 2
3 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1447705
Note that a boolean in C++ uses values 1 and 0. While in VB it uses -1 and 0.
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 100 total points
ID: 1447706
Note that a boolean in C++ uses values 1 and 0. While in VB it uses -1 and 0.
0
 

Author Comment

by:skin
ID: 2242144
My experience is that ByRef only works for variants in VB Script
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now