Solved

Event parameter passed by reference doesn't work using VBScript

Posted on 1998-12-02
2
322 Views
Last Modified: 2013-11-20
I have an Event "MyContextMenu" that I fire right before I plan to display a context menu.  It contains a BOOL* parameter bDisable that is passed by reference so if the client sets that to TRUE I will not put up the context menu.  This works fine in VB but when I try it in VBScript, it doesn't return the value the client passed.
Here is the definition for my event:
void FireMyContextMenu(BOOL FAR* bDisable)
{FireEvent(eventidMyContextMenu,EVENT_PARAM(VTS_PBOOL), bDisable);}
Here is the entry from the ODL:
[id(1)] void MyContextMenu(boolean* bDisable);
And finally here is the call to fire the event:
BOOL bDisable = FALSE;
FireMyContextMenu(&bDisable);// After this call with the following VBScript code bDisable should be TRUE
VBScript:
Sub Test2_MyContextMenu(bDisable)
bDisable = True
End Sub

Any ideas what I can do to make this work in both VB and VBScript without changing the data type (it's in the field already).
Thanks,
Steve


0
Comment
Question by:skin
2 Comments
 

Author Comment

by:skin
ID: 1325668
Edited text of question
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1325669
Sorry, but you will need to change the type of the event. The reason is VBScript only understands two data types: VARIANTs and IDispatch. Everything else is an error or ignored.

So instead of using BOOL*, you need to use VARIANT*.


0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

13 Experts available now in Live!

Get 1:1 Help Now