[racket] Fwd: MysterX

From: José António Branquinho de Oliveira Lopes (jose.lopes at ist.utl.pt)
Date: Thu Feb 24 12:52:25 EST 2011

If I'm understanding correctly, "pTypeDesc" is initialized with a call  
to "getMethodType", which in turn calls "typeInfoFromComObject", to  
get the object type information. However, because no such information  
exists, in this case, it raises an exception (scheme_signal_error),  
with the message "COM object does not expose type information".

Therefore, I'm thinking that maybe the initialization of "pTypeDesc"  
should catch the exception, otherwise "buildMethodArguments" will  
never be called.

What do you think?

--
José

Quoting Joe Marshall <jmarshall at alum.mit.edu>:

> 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.
>
> --
> ~jrm
>



José António Branquinho de Oliveira Lopes
58612 - MEIC-A
jose.lopes at ist.utl.pt




Posted on the users mailing list.