News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

COM: LoadT ypeLibrary

Started by milev, November 28, 2012, 08:19:27 PM

Previous topic - Next topic

milev

there is a serious bug in it. this add-in treats IDispatch as the default COM interface, but it should be IUnknown. so instead of Getting THIS (which is a redefinition of interface) the add-ins put a pointer to IDispatch interface
so the correct way of an interface (member) declaration should be so:

/* THE CORRECT ONE */
   STDMETHOD(QueryInterface)(THIS_ REFIID,void**);
   STDMETHOD_(ULONG,AddRef)(THIS );
   STDMETHOD_(ULONG,Release)(THIS );

instead of:

/* THE WRONG ONE */

   STDMETHOD(QueryInterface)(Idispatch*, REFIID,void**);
   STDMETHOD_(ULONG,AddRef)(Idispatch*);
   STDMETHOD_(ULONG,Release)(Idispatch*);

remember the minimum implementation (interface ) of a COM Object is IUnknown, that means IUnknown is mandatory, but IDispatch is not (optional and only useful for scripting automation).

I hope this information (reminding) will help some one some where :)

Milev