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(
  [in]  PVOID     pvData,
  [in]  LPCOLESTR szFieldName,
  [out] VARIANT   *pvarField,
  [out] PVOID     *ppvDataCArray
);

Parameters

[in] pvData

The instance of a record.

[in] szFieldName

The name of the field.

[out] pvarField

The VARIANT that will contain the UDT upon return.

[out] 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

Requirement Value
Target Platform Windows
Header oaidl.h

See also

IRecordInfo

VariantClear