[racket] Fwd: MysterX

From: Joe Marshall (jmarshall at alum.mit.edu)
Date: Thu Feb 24 12:39:37 EST 2011

2011/2/24 José António <jose.lopes at ist.utl.pt>:
> And how do I perform a "blind call"?

It's been more than five years since I've worked with MysterX,
so my memory is rusty.

The source is in racket/src/mysterx/mysterx.cc
The relevant method is mx_make_call
It looks like if there is no pTypeDesc for the method (no typelib),
then it calls buildMethodArgumentsUsingDefaults to marshal the
arguments into a VARIANT with a default marshaling.  It then tries to
use the IDispatch interface (COM Automation) to find the method entry.
Nothing will be checked, so if it doesn't work, bad things will happen,
but it works well enough for the simple stuff.  If your object doesn't
support IDispatch, then you are out of luck (because then we don't
even know the offset of the method in the vtable)

>From the look of it, though, if your COM object does support IDispatch,
then you ought to be able to invoke a method by name using the
Scheme primitive com-invoke even if you don't have a typelib.  Just call
it and cross your fingers.


Posted on the users mailing list.