Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Event parameter passed by reference doesn't work using VBScript

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

704 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