Solved

Event parameter passed by reference doesn't work using VBScript

Posted on 1998-12-02
2
333 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

626 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