A
André Hänsel
Hi,
in a tutorial about COM objects, I am told to declare the following
things:
typedef HRESULT STDMETHODCALLTYPE QueryInterfacePtr(Example *, REFIID,
void **);
typedef ULONG STDMETHODCALLTYPE AddRefPtr(Example *);
typedef ULONG STDMETHODCALLTYPE ReleasePtr(Example *);
typedef struct {
QueryInterfacePtr *QueryInterface;
AddRefPtr *AddRef;
ReleasePtr *Release;
} ExampleVtbl;
typedef struct {
ExampleVtbl* lpVtbl;
DWORD count;
} Example;
In this order it doesn't work, of course. When QueryInterfacePtr is
declared, the compiler doesn't know about the Example type. When I
switch the two blocks, it's the same problem the other way around, it
doesn't know about QueryInterfacePtr.
But I cannot figure out which declarations I have to use to resolve
this.
Regards,
André
in a tutorial about COM objects, I am told to declare the following
things:
typedef HRESULT STDMETHODCALLTYPE QueryInterfacePtr(Example *, REFIID,
void **);
typedef ULONG STDMETHODCALLTYPE AddRefPtr(Example *);
typedef ULONG STDMETHODCALLTYPE ReleasePtr(Example *);
typedef struct {
QueryInterfacePtr *QueryInterface;
AddRefPtr *AddRef;
ReleasePtr *Release;
} ExampleVtbl;
typedef struct {
ExampleVtbl* lpVtbl;
DWORD count;
} Example;
In this order it doesn't work, of course. When QueryInterfacePtr is
declared, the compiler doesn't know about the Example type. When I
switch the two blocks, it's the same problem the other way around, it
doesn't know about QueryInterfacePtr.
But I cannot figure out which declarations I have to use to resolve
this.
Regards,
André