IRecordInfo::GetFieldNoCopy method

Returns a pointer to the value of a given field name without copying the value and allocating resources.

Syntax


HRESULT GetFieldNoCopy(
  [in]  PVOID     pvData,
  [in]  LPCOLESTR szFieldName,
  [out] VARIANT   *pvarField,
  [out] PVOID     *ppvDataCArray
);

Parameters

pvData [in]

The instance of a record.

szFieldName [in]

The name of the field.

pvarField [out]

The VARIANT that will contain the UDT upon return.

ppvDataCArray [out]

Receives the value of the field upon return.

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.

 

Remarks

Upon return, the VARIANT you pass contains a direct pointer to the record's field, ppvDataCArray. If you modify the VARIANT, then the underlying record field will change.

The caller allocates memory of the VARIANT, but does not own the memory so cannot free pvarField. This method calls VariantClear for pvarField before filling in the requested field.

Requirements

IDL

OaIdl.idl

See also

VariantClear
IRecordInfo

 

 

Show: