include: Drop outdated comment about COM interface implementations.

This commit is contained in:
Michael Stefaniuc 2012-06-09 01:13:42 +02:00 committed by Alexandre Julliard
parent f1cd213931
commit 4e95936548
1 changed files with 1 additions and 42 deletions

View File

@ -41,7 +41,7 @@
* virtual methods in C++ and a structure with a table of pointer to functions in C.
* Unfortunately the layout of the virtual table is compiler specific, the layout of
* g++ virtual tables is not the same as that of an egcs virtual table which is not the
* same as that generated by Visual C+. There are workarounds to make the virtual tables
* same as that generated by Visual C++. There are workarounds to make the virtual tables
* compatible via padding but unfortunately the one which is imposed to the WINE emulator
* by the Windows binaries, i.e. the Visual C++ one, is the most compact of all.
*
@ -168,47 +168,6 @@
* - Of course in C++ we use inheritance so that we don't have to duplicate the method definitions.
* - Finally there is no IDirect3D_Xxx macro. These are not needed in C++ unless the CINTERFACE
* macro is defined in which case we would not be here.
*
*
* Implementing a COM interface.
*
* This continues the above example. This example assumes that the implementation is in C.
*
* typedef struct IDirect3DImpl {
* void* lpVtbl;
* // ...
*
* } IDirect3DImpl;
*
* static IDirect3DVtbl d3dvt;
*
* // implement the IDirect3D methods here
*
* int IDirect3D_QueryInterface(IDirect3D* me)
* {
* IDirect3DImpl *This = (IDirect3DImpl *)me;
* // ...
* }
*
* // ...
*
* static IDirect3DVtbl d3dvt = {
* IDirect3D_QueryInterface,
* IDirect3D_Add,
* IDirect3D_Add2,
* IDirect3D_Initialize,
* IDirect3D_SetWidth
* };
*
* Comments:
* - We first define what the interface really contains. This is the IDirect3DImpl structure. The
* first field must of course be the virtual table pointer. Everything else is free.
* - Then we predeclare our static virtual table variable, we will need its address in some
* methods to initialize the virtual table pointer of the returned interface objects.
* - Then we implement the interface methods. To match what has been declared in the header file
* they must take a pointer to an IDirect3D structure and we must cast it to an IDirect3DImpl so
* that we can manipulate the fields.
* - Finally we initialize the virtual table.
*/
#if defined(__cplusplus) && !defined(CINTERFACE)