View Single Post
Old 11-28-2006, 08:52 PM   #19
bgallagher
Newbie
 
bgallagher's Avatar
 
Join Date: Jul 2006
Location: Oceanside, CA.
Vehicle: 02/Ford/GT Mustang
Posts: 5
My Photos: ()
Quote: Originally Posted by nakinney View Post
bgallagher, did you ever figure out how to send COM events to vbscript from a DLL written in C#? I have a written Sirius comunication library using C# that is done except for the fact that I'm having difficulty sending the events.

Everything works fine in VB6 and .NET....

Regarding the .NET event problem, there are a couple of ways to register events in VBScript but this engine does not support them. Typically, to do this in a scripting environment you would use Wscript's version of
CreateObject that defines a "prefix" to hook the events or you could declare your variables using 'WithEvents'.

I ended up following Chuck's instructions by manually triggering my methods once they are stored and invoking them as needed in my DLL. Now, in .NET when you want to pass parameters by reference when late binding to COM members via IDispatch, you must pass an array with only a single "ParameterModifier" element that is initialized with the number of parameters in the member being invoked. If you need sample code, I can provide.

-Brian
__________________
STIC
bgallagher is offline   Reply With Quote