Solved

Event parameter passed by reference doesn't work using VBScript

Posted on 1998-12-02
2
330 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
function returning CString in a regular win32 DLL 8 216
Separate into files by filename 12 92
maxBlock challenge 30 151
JQuery serialize and unserialize 8 275
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

710 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