Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Event parameter passed by reference doesn't work using VBScript

Posted on 1998-12-02
2
Medium Priority
?
348 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 400 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

885 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