IRecordInfo::PutField method

Puts a variant into a field.

Syntax


HRESULT PutField(
  [in]       ULONG wFlags,
  [in, out]  PVOID pvData,
  [in]       LPCOLESTR szFieldName,
  [in]       VARIANT *pvarField
);

Parameters

wFlags [in]

The only legal values for the wFlags parameter is INVOKE_PROPERTYPUT or INVOKE_PROPERTYPUTREF.

If INVOKE_PROPERTYPUTREF is passed in then PutField just assigns the value of the variant that is passed in to the field using normal coercion rules.

If INVOKE_PROPERTYPUT is passed in then specific rules apply. If the field is declared as a class that derives from IDispatch and the field's value is NULL then an error will be returned. If the field's value is not NULL then the variant will be passed to the default property supported by the object referenced by the field. If the field is not declared as a class derived from IDispatch then an error will be returned. If the field is declared as a variant of type VT_Dispatch then the default value of the object is assigned to the field. Otherwise, the variant's value is assigned to the field.

pvData [in, out]

The pointer to an instance of the record.

szFieldName [in]

The name of the field of the record.

pvarField [in]

The pointer to the variant.

Return value

This method can return one of these values.

Return codeDescription
S_OK

Success.

E_INVALIDARG

One or more of the arguments is not valid.

 

Requirements

IDL

OaIdl.idl

See also

IRecordInfo

 

 

Community Additions

ADD
Show:
© 2015 Microsoft