Pelles C forum

Pelles C => Bug reports => Topic started by: milev on November 28, 2012, 08:19:27 PM

Title: COM: LoadT ypeLibrary
Post by: milev on November 28, 2012, 08:19:27 PM
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