CComDispatchDriver::PutProperty

HRESULT PutProperty( DISPID dwDispID, VARIANT* var );

static HRESULT PutProperty( IDispatch* pDisp, DISPID dwDispID, VARIANT* var );

Return Value

One of the standard HRESULT values.

Parameters

dwDispID

[in] The DISPID of the property to be set. The DISPID can be obtained from IDispatch::GetIDsOfNames.

var

[in] Pointer to the property value to be set.

pDisp

[in] Pointer to the IDispatch interface.

Remarks

Sets the value of the property identified by dwDispID to the value in var. If you supply pDisp, that IDispatch pointer is used. If you do not, the IDispatch pointer contained in the data member p is used. 

The following code illustrates PutProperty:

DISPID dwDispID;
VARIANT var;
HRESULT hRes;
OLECHAR *szMember = "ThisProperty";
VariantInit(&var)
...
hRes = pDisp->GetIDsOfNames(IID_NULL, szMember, 1, LOCALE_USER_DEFAULT, &dwDispID);
hRes = CComDispatchDriver::PutProperty(pDisp, dwDispID, &var);

CComDispatchDriver OverviewClass Members

See Also   CComDispatchDriver::GetProperty