Article ID: 174635
Article Last Modified on 7/5/2005
170365 INFO: Visual Studio 97 Service Packs - What, Where, and Why
IUnknown* f( const _variant_t & vt )
{
if (V_VT(&vt) == VT_UNKNOWN)
{
V_UNKNOWN(&vt)->AddRef();
return V_UNKNOWN(&vt);
}
_variant_t vttmp;
vttmp.ChangeType(VT_UNKNOWN, &vt);
V_UNKNOWN(&vttmp)->AddRef();
return V_UNKNOWN(&vttmp);
}
void g()
{
_variant_t vt;
IUnknown * punk=0;
// ...some code...
punk = vt; // will cause _variant_t::operator IUnknown*()
// to be called. Comment this out.
//punk = f(vt); // call f instead. Uncomment for workaround
// ...more code...
}
Additional query words: refcount Release
Keywords: kbbug kbfix kbvc600fix kbvs97sp2fix KB174635