passing pointer to a vbs function to C# code -
06-13-2009
, 09:07 PM
Hello All,
I have an app that can be controlled by vbscript. Due to a new requirement I
would like to be able to register a vbs function that my C# app could invoke
from a different thread. I have used a small dll that did the same in C++
but I do not have the code for that C++ dll anymore and I am kind of stuck.
I know that in the vbs file I need to use the GetRef() function that gets
the pointer to the function. I can also pass in this object to the C# code
as object, but I do not know what I should do with it.
One guess is that this object might be an IDispatch object and if I could
invoke its default function than that function would be what I am looking
for, but I am not sure, it is only a guess. Also I have no idea how I could
invoke the default function from C# because I could not find an IDispatch
wrapper in the System.Runtime.InteropServices.ComTypes namespace; I guess
there is a reason for that and IDispatch might not be used from the .NET
framework?
I'd appreciate any help!
Thank you,
Jozsef |