COM inheritence

Robert Shearman rob at codeweavers.com
Mon Oct 11 17:12:03 CDT 2004


Ann and Jason Edmeades wrote:

>However, this would seem something which is so common - ie inheritence is
>used all over the place. How do people handle this? I've looked through a
>few places in the code and cant see how this can be done. I could 'pretend'
>by initializing the Vtbl as I create the com object and do some LoadLibrary
>type dynamic addressing but I really want link time resolution not load time
>resolution.
>
>One solution would be to put the common routines in a header file, and
>#include it, but code in headers or #including modules is uaually frowned
>upon! I cant see any sensible way of doing this and I'd rather not do lots
>of code duplication if avoidable as this common class is used in about 7
>other classes!
>  
>

Have a look at dlls/quartz/pin.h
I have emulated C++ style inheritance by creating a structure that is 
included at the start of every derived implementation and then 
constructing the vtable at compile time and linking to the base 
functions. If you wanted to do the same for d3d{8,9} and wined3d you 
would have to add each common function to the spec file.

Rob




More information about the wine-devel mailing list