Jump to content

[COM] ObjCreateInterface v-table order?


Recommended Posts

In help file said that:

Methods listed inside description string must be in v-table order of the interface.

how do you know this order?

For example:

i try to create IEnumUnknown interface http://msdn.microsoft.com/en-us/library/windows/desktop/ms683764(v=vs.85).aspx

It has members: Clone, Next,Reset,Skip

But as will be correct?

$dTag_IEnumUnknown = _
"Clone hresult(ptr*);" & _
"Skip hresult(ulong);" & _
"Next hresult(ulong;ptr*;ulong*);" & _
"Reset hresult();"

or

$dTag_IEnumUnknown = _
"Clone hresult(ptr*);" & _
"Next hresult(ulong;ptr*;ulong*);" & _
"Reset hresult();" & _
"Skip hresult(ulong);"

or it does not matter?

Link to comment
Share on other sites

I think this will help

Unfortunately no...

as I understand it, the interface IEnumUnknowncontained - in the library ole32.dll that the program was unable to open.

but if you look at the file ObjIdl.h

....
MIDL_INTERFACE("00000100-0000-0000-C000-000000000046")
IEnumUnknown : public IUnknown
{
public:
virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next(
/* [annotation][in] */
__in ULONG celt,
/* [annotation][out] */
__out_ecount_part(celt,*pceltFetched) IUnknown **rgelt,
/* [annotation][out] */
__out_opt ULONG *pceltFetched) = 0;

virtual HRESULT STDMETHODCALLTYPE Skip(
/* [in] */ ULONG celt) = 0;

virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;

virtual HRESULT STDMETHODCALLTYPE Clone(
/* [out] */ __RPC__deref_out_opt IEnumUnknown **ppenum) = 0;

};
.....

it seems to me that the correct order would be:

Next;Skip;Reset;Clone

$dtag_IEnumUnknown = "Next hresult(ulong;ptr*;ulong*);Skip hresult(ulong);Reset hresult();Clone hresult(ptr*);"

though maybe I'm wrong :rolleyes:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...