Export (0) Print
Expand All
ATL
Expand Minimize
2 out of 2 rated this helpful - Rate this topic

COM_INTERFACE_ENTRY_FUNC 

A general mechanism for hooking into ATL's QueryInterface logic.


COM_INTERFACE_ENTRY_FUNC( iid, dw, func )

Parameters

iid

[in] The GUID of the interface exposed.

dw

[in] A parameter passed through to the func.

func

[in] The function pointer that will return iid.

If iid matches the IID of the interface queried for, then the function specified by func is called. The declaration for the function should be:

HRESULT WINAPI func(void* pv, REFIID riid, LPVOID* ppv, DWORD dw);

When your function is called, pv points to your class object. The riid parameter refers to the interface being queried for, ppv is the pointer to the location where the function should store the pointer to the interface, and dw is the parameter you specified in the entry. The function should set *ppv to NULL and return E_NOINTERFACE or S_FALSE if it chooses not to return an interface. With E_NOINTERFACE, COM map processing terminates. With S_FALSE, COM map processing continues, even though no interface pointer was returned. If the function returns an interface pointer, it should return S_OK.

See COM_INTERFACE_ENTRY Macros for remarks about COM map entries.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.