How to Get property value if it returns BSTR
ATL / WTL / STL
1
Posts
1
Posters
0
Views
1
Watching
-
I have a com object in which there are different properties. When i get these values through it works well when property is returning long or some other integer but it crashes when property is returning bstr. Take a look at my code and guide me that what i did wrong. VARIANT pvResult; memset(&pvResult, 0, sizeof pvResult); VariantInit(&pvResult); DISPID dispID=this->pColl->getMemberID(index); DISPPARAMS dispParamsNoArgs={NULL,NULL,0,0}; HRESULT hr=pDispatch->Invoke(dispID,IID_NULL,LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET,&dispParamsNoArgs, &pvResult,NULL,&nArgErr); Thanx in advance Inam