| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| I hope I unerstand the question correctly but normally its done like this. IDispatch* pDisp VariantInit(rVal); if (SUCCEEDED(hr = CoCreateInstance(CLSID_Toc, NULL, CLSCTX_ALL, __uuidof(IToc), (void **)&pDisp))) { pVal->vt = VT_DISPATCH; pVal->pdispVal = pDisp; } "Serve Laurijssen" <cs@comp.com> wrote in message news:_DV6b.36394$tK5.4354682@zonnet-reader-1... > What's the correct way to pass a regular C++ object with a COM interface? > I now have this but I'm not sure how to fill in the vt field. > > if (SUCCEEDED(hr = CoCreateInstance(CLSID_Toc, NULL, CLSCTX_ALL, > __uuidof(IToc), (void **)retval))) > { > > VARIANT v; > v.vt = ???? > v.byref = m_pIndexSet; > hr = static_cast<IToc *>(*retval)->getRootLevel(level, &v); > } > > |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.