DataObject.IDataObject.GetCanonicalFormatEtc(FORMATETC, FORMATETC) 方法

定義

提供標準的 FORMATETC 結構,這個結構在邏輯上相當於更複雜的結構。 使用這個方法判斷兩個不同的 FORMATETC 結果是否會傳回相同的資料,而不需要重複呈現。

 virtual int System.Runtime.InteropServices.ComTypes.IDataObject.GetCanonicalFormatEtc(System::Runtime::InteropServices::ComTypes::FORMATETC % pformatetcIn, [Runtime::InteropServices::Out] System::Runtime::InteropServices::ComTypes::FORMATETC % pformatetcOut) = System::Runtime::InteropServices::ComTypes::IDataObject::GetCanonicalFormatEtc;
[System.Security.SecurityCritical]
int IDataObject.GetCanonicalFormatEtc (ref System.Runtime.InteropServices.ComTypes.FORMATETC pformatetcIn, out System.Runtime.InteropServices.ComTypes.FORMATETC pformatetcOut);
int IDataObject.GetCanonicalFormatEtc (ref System.Runtime.InteropServices.ComTypes.FORMATETC pformatetcIn, out System.Runtime.InteropServices.ComTypes.FORMATETC pformatetcOut);
[<System.Security.SecurityCritical>]
abstract member System.Runtime.InteropServices.ComTypes.IDataObject.GetCanonicalFormatEtc : FORMATETC * FORMATETC -> int
override this.System.Runtime.InteropServices.ComTypes.IDataObject.GetCanonicalFormatEtc : FORMATETC * FORMATETC -> int
abstract member System.Runtime.InteropServices.ComTypes.IDataObject.GetCanonicalFormatEtc : FORMATETC * FORMATETC -> int
override this.System.Runtime.InteropServices.ComTypes.IDataObject.GetCanonicalFormatEtc : FORMATETC * FORMATETC -> int
Function GetCanonicalFormatEtc (ByRef pformatetcIn As FORMATETC, ByRef pformatetcOut As FORMATETC) As Integer Implements IDataObject.GetCanonicalFormatEtc

參數

pformatetcIn
FORMATETC

以傳址方式傳遞的 FORMATETC 結構的指標,定義呼叫端在後續呼叫 (例如 GetData(FORMATETC, STGMEDIUM)) 中要用來擷取資料的格式、媒體和目標裝置。 TYMED 成員在這種情況下並不重要,可以略過。

pformatetcOut
FORMATETC

當這個方法傳回時,會包含 FORMATETC 結構的指標,結構中含有特定呈現可能適用的最普遍資訊,使它在標準上相當於 formatetcIn。 呼叫端必須配置這個結構,且 GetCanonicalFormatEtc(FORMATETC, FORMATETC) 方法必須填入資料。 為了在後續呼叫 (例如 GetData(FORMATETC, STGMEDIUM)) 中擷取資料,除非提供值為 null,否則呼叫端會使用 formatOut 的提供值。 如果方法傳回 null,這個值便為 DATA_S_SAMEFORMATETCTYMED 成員在這種情況下並不重要,可以略過。 這個參數會以未初始化的狀態傳遞。

傳回

這個方法支援標準傳回值 E_INVALIDARG、E_UNEXPECTED 和 E_OUTOFMEMORY,以及下列值:

描述
S_OK 傳回的 FORMATETC 結構與傳遞的結構不同。
DATA_S_SAMEFORMATETC FORMATETC 結構相同,且 formatOut 參數中傳回 null
DV_E_LINDEX lindex 有一個無效的值;目前只支援 -1。
DV_E_FORMATETC pFormatetc 參數有一個無效的值。
OLE_E_NOTRUNNING 此應用程式未正在執行中。

實作

屬性

備註

這個成員是明確介面成員實作, 只有在 DataObject 執行個體轉換成 IDataObject 介面時,才能使用這個成員。

適用於