RE: wrapping DX
- Posted by Matthew Lewis <matthewwalkerlewis at YAHOO.COM> May 29, 2001
- 456 views
> -----Original Message----- > From: Bernie Ryan [mailto:xotron at localnet.com] > Although I don't understand your code. > Here are some possible reasons for your code not working. > > 1. Non-virtual functions do not appear in the vtable. No, all COM interface member functions are virtual, so I don't think this would have any bearing. > 2. Stack order is not correct going from C++ to Euphoria ( > try reversing the parameter list ). Nope. Already reversed. The functions aren't even seeing the parameter list. > 3. Euphoria interfaces with "C" and C++ maybe mangling the names ( > inside your DLL ). No, I don't look for names at all. Basically, I'm handed the address to a pointer to a C++ object (the 'this' pointer for the object). The pointer contains the address of the vtable. I'm supposed to be able to use those two pieces of information to call any function in the interface (look up the address of the function, and pass the 'this' pointer as the first argument) just as if I were calling from C++. Every other interface I've encountered thus far works that way. But this one seems to know if I'm calling from C++ or not--of course, this contradicts MS's own COM specifications <insert MS joke here>. I suppose I'll have to dissassemble the darn thing to figure out what it's doing differently... > 4. A Structure is not formed properly. > 5. Trying to pass a structure by value. Thanks, Matt Lewis