some unimplemented COM stuff
wowbagger at sktc.net
Wed May 30 06:55:28 CDT 2001
> Because all I have is an IDispatch pointer and a vtable offset to the method.
> Calling Invoke itself is not a problem at all. The method to be called by
> Invoke isn't known at compile time.
It sounds to me like you have an impedance mismatch: you have a system
that wants to call a C linkage function, and you want to tie it into a
What you'll have to do is something like this:
virtual RETTYPE Real_func(arg1, arg2, <etc>) = 0;
static RETTYPE Entry_func_stub(void *dis, arg1, arg2, <etc>)
Base_class *ptr = (Base_class *)dis;
class Child1: public Base_class
Class Child2: public Base_class
The stub function in the base class can be coorced into having non-C++
linkage with an appropriate declaration, and will call the appropriate
vtable entry and offset the this pointer correctly.
While I've not done this under Wine or Windows, I have done this sort of
thing in several RTOSs with great success.
More information about the wine-devel