HRESULT FAR EXPORT CSecurity::XJohnObj::QueryInterface(
REFIID iid, LPVOID FAR* ppvObj)
{
METHOD_PROLOGUE(CSecurity, JohnObj)
return pThis->ExternalQueryInterface(iid, ppvObj);
}
I get the error..
error C2664: 'ExternalQueryInterface' : cannot convert parameter 1 from 'const struct ::GUID ' to 'const void __far *'
I can't cast iid to anything useful so now I'm stuck - HELP!!!!
p.s. I'm still using v1.51 perhaps this is fixed in 1.52/4.0
Many Thanks - John Dudmesh
> I'm trying to declare a custom interface from a CCmdTarget derived
> class. The BEGIN_INTERFACE_PART macro defines the IUnknown functions
> but the sample code for the QueryInterface implemntation in TechNote
> 38 does not work -
>
> HRESULT FAR EXPORT CSecurity::XJohnObj::QueryInterface(
> REFIID iid, LPVOID FAR* ppvObj)
> {
> METHOD_PROLOGUE(CSecurity, JohnObj)
> return pThis->ExternalQueryInterface(iid, ppvObj);
> }
>
> I get the error..
> error C2664: 'ExternalQueryInterface' : cannot convert parameter 1 from 'const struct ::GUID ' to 'const void __far *'
For some reason CCmdTarget::ExternalQueryInterface() takes a void *
as the first paramter and then casts it back into a IID * internally. If you
cast the iid first all should be ok.
return pThis->ExternalQueryInterface((void*)iid,ppvObj);
Kev.
---------------------------------------------------------------------------
Kevin Jones k...@mlkeeley.demon.co.uk
Missing Link Software plc.
---------------------------------------------------------------------------