Re: passing C++ object in VARIANT

This is a discussion on Re: passing C++ object in VARIANT within the Inetserver forums in Microsoft Tools category; 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 = ...

Go Back   Application Development Forum > Microsoft Tools > Inetserver

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-10-2003, 09:20 AM
Bill
Guest
 
Default Re: passing C++ object in VARIANT

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);
> }
>
>



Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 05:23 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.