iid_is and use of void*
The use of "void*" pointers are permitted, as long as such pointers are qualified with an "iid_is" pointer attribute. See [CAE RPC], page 253.
<ptr_attr> ::= ref
| ptr
| iid_is ( <attr_var_list> )
| unique3.
The iid_is construct says that the void* parameter is an interface pointer whose type is only known at run time, but whose interface ID is the parameter named in the iid_is attribute. For example:
[object, uuid(b5483f00-4f6c-101b-a1c7-00aa00389acb)]
interface IBar : IWazoo {
Bar([in] short i, [in, ref] uuid_t *piid, [out, iid_is(piid)] void ** ppvoid);
};
This can be invoked in C++ as:
IFoo* pIF;
pIB->Bar(i, &IID_IFoo, (void*)&pIF);
where "IID_IFoo" is the name of a constant whose value is the interface ID for IFoo.