IRecordInfo::GetFieldNoCopy method (oaidl.h)

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

Syntax

HRESULT GetFieldNoCopy(
  PVOID     pvData,
  LPCOLESTR szFieldName,
  VARIANT   *pvarField,
  PVOID     *ppvDataCArray
);

Parameters

pvData

The instance of a record.

szFieldName

The name of the field.

pvarField

The VARIANT that will contain the UDT upon return.

ppvDataCArray

Receives the value of the field upon return.

Return value

This method can return one of these values.

Return code Description
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

   
Target Platform Windows
Header oaidl.h

See also

IRecordInfo

VariantClear