Memory Access problems (possibly)...

Andreas Raab raab at isgnw.cs.Uni-Magdeburg.DE
Tue May 26 00:24:09 UTC 1998


> >c) You might have forgotten to pass on the pointer to the interface
> >   itself. This is in principle equal to b) since there is just one
> >   parameter wrong which is quite a significant pointer.
> 
> 
> Unfortunatly, the function I am trying to call is simply AddRef of the
> IUnknown interface, and thus I am passing no arguments at all.  Any other
> ideas?

That's point c) since COM uses C++ calls which always have the pointer to
the instance (in your case the interface) as argument. Taken from the
Win32 SDK "unknwn.h" file the C style declaration looks like:

  ULONG AddRef(IUnknown * This);

You should also keep in mind that all COM functions use C++ virtual
methods meaning that the actual function pointer is obtained by a
lookup in the interface which is basically an array with all sorts of
function pointers. Don't even *think* of interpreting the interface you
obtain as a function address. BTW, I'm really interested how you want to
interface COM without parsing the entire header files for making sure
that you're not coding the indices for the functions wrong. I've tried
this once but given up and decided to stay with a wrapper DLL instead.

Bye,
  Andreas

-- 
Linear algebra is your friend - Trigonometry is your enemy.
+===== Andreas Raab ============= (raab at isg.cs.uni-magdeburg.de) =====+
I Department of Simulation and Graphics      Phone: +49 391 671 8065  I
I University of Magdeburg, Germany           Fax:   +49 391 671 1164  I
+=============< http://isgwww.cs.uni-magdeburg.de/~raab >=============+





More information about the Squeak-dev mailing list