Re: COM inheritance Q

2005-01-13 Thread Mike Hearn
On Thu, 13 Jan 2005 15:21:27 -0600, Robert Shearman wrote: > But you'll get a warning because the WineD3DResource functions will take > a different type iface variable as their first parameter. You could cast > it to the correct type, but you'll lose all type checking on the > function and I wou

RE: COM inheritance Q

2005-01-13 Thread Ann and Jason Edmeades
>So, IWineD3DSurface should inherit from IWineD3DResource which in >turn should inherit from IUnknown. Then you fill out the vtable >appropriately for overrides. Isn't object orientation in C fun :) > >typedef struct >{ > IWineD3DSurfaceVtbl *lpVtbl; > DWORD refcount; > >} WineD3DS

Re: COM inheritance Q

2005-01-13 Thread Robert Shearman
Mike Hearn wrote: On Thu, 13 Jan 2005 20:33:10 +, Ann and Jason Edmeades wrote: Whats the solution? In d3d8 I would have coded IWineD3DSurfaceImpl_GetParent as IWineD3DResourceImpl_GetParent(iface, pParent) because the Impl versions were prototyped - Is this the only way to solve this?

Re: COM inheritance Q

2005-01-13 Thread Robert Shearman
Ann and Jason Edmeades wrote: I have code which looks like: HRESULT WINAPI IWineD3DSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pParent) { return IWineD3DResource_GetParent((IWineD3DResource *)iface, pParent); } IWineD3DResource_GetParent is a macro: #define IWineD3DSurface_GetParent(

Re: COM inheritance Q

2005-01-13 Thread Raphael
On Thursday 13 January 2005 22:09, you wrote: > >Jason seems to have: > >- IWineD3DSurface inherits from IWineD3DResource > >- IWineD3DResource inherits from IUnknown > > Yep... > > >Jason, why IWineD3DSurface inherits from IWineD3DResource ? > > Well wine has > > /*

Re: COM inheritance Q

2005-01-13 Thread Mike Hearn
On Thu, 13 Jan 2005 20:33:10 +, Ann and Jason Edmeades wrote: > Whats the solution? > > In d3d8 I would have coded IWineD3DSurfaceImpl_GetParent as > IWineD3DResourceImpl_GetParent(iface, pParent) because the Impl versions > were prototyped - Is this the only way to solve this? I'm kind of co

RE: COM inheritance Q

2005-01-13 Thread Ann and Jason Edmeades
>Jason seems to have: >- IWineD3DSurface inherits from IWineD3DResource >- IWineD3DResource inherits from IUnknown Yep... >Jason, why IWineD3DSurface inherits from IWineD3DResource ? Well wine has /*** ** * IDirect3DSur

RE: COM inheritance Q

2005-01-13 Thread Ann and Jason Edmeades
>>I have code which looks like: >> >>HRESULT WINAPI IWineD3DSurfaceImpl_GetParent(IWineD3DSurface *iface, >>IUnknown **pParent) { >>return IWineD3DResource_GetParent((IWineD3DResource *)iface, pParent); >>} >> >>IWineD3DResource_GetParent is a macro: >>#define IWineD3DSurface_GetParent(p,a) >>

Re: COM inheritance Q

2005-01-13 Thread Raphael
On Thursday 13 January 2005 21:43, Robert Shearman wrote: > Ann and Jason Edmeades wrote: > >Hiya, > > > >In the wined3d code I have, for example, a class surface which inherits a > >lot of methods of Resource. Most of these methods can be called as-is, and > > I have code which looks like: > > > >

Re: COM inheritance Q

2005-01-13 Thread Robert Shearman
Ann and Jason Edmeades wrote: Hiya, In the wined3d code I have, for example, a class surface which inherits a lot of methods of Resource. Most of these methods can be called as-is, and I have code which looks like: HRESULT WINAPI IWineD3DSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pPar

COM inheritance Q

2005-01-13 Thread Ann and Jason Edmeades
Hiya, In the wined3d code I have, for example, a class surface which inherits a lot of methods of Resource. Most of these methods can be called as-is, and I have code which looks like: HRESULT WINAPI IWineD3DSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pParent) { return IWineD3DR