ClipboardObject.IDataObject.GetCanonicalFormatEtc 方法

提供一个在逻辑上与更复杂的结构等效的标准 FORMATETC 结构。使用此方法来确定两个不同 FORMATETC 结构是否返回相同的数据,不再需要对复制呈现。

命名空间:  Microsoft.VisualStudio.Data.Framework
程序集:  Microsoft.VisualStudio.Data.Framework(在 Microsoft.VisualStudio.Data.Framework.dll 中)

语法

声明
Private Function GetCanonicalFormatEtc ( _
    ByRef formatIn As FORMATETC, _
    <OutAttribute> ByRef formatOut As FORMATETC _
) As Integer Implements IDataObject.GetCanonicalFormatEtc
int IDataObject.GetCanonicalFormatEtc(
    ref FORMATETC formatIn,
    out FORMATETC formatOut
)
private:
virtual int GetCanonicalFormatEtc(
    FORMATETC% formatIn, 
    [OutAttribute] FORMATETC% formatOut
) sealed = IDataObject::GetCanonicalFormatEtc
private abstract GetCanonicalFormatEtc : 
        formatIn:FORMATETC byref * 
        formatOut:FORMATETC byref -> int 
private override GetCanonicalFormatEtc : 
        formatIn:FORMATETC byref * 
        formatOut:FORMATETC byref -> int 
JScript 不支持显式接口实现。

参数

  • formatOut
    类型:System.Runtime.InteropServices.ComTypes.FORMATETC%
    当此方法返回时,此参数包含指向包含该一般信息可以为特定呈现的 FORMATETC 结构,使其规范等效于 pformatectIn。调用方必须将此结构,因此,GetCanonicalFormatEtc 方法必须填充数据。除非所提供的值是 nullnull 引用(在 Visual Basic 中为 Nothing),若要检索中的数据对的调用,如 IDataObject.GetData,调用方使用 pformatetcOut中提供的值。如果方法返回 DATA_S_SAMEFORMATETC,此值为null。在此情况下,tymed 成员并无意义,应将其忽略。该参数未经初始化即被传递。

返回值

类型:System.Int32
此方法支持该条件返回值 E_INVALIDARG、 E_UNEXPECTED和 E_OUTOFMEMORY,以及示:

说明

S_OK

返回的FORMATETC结构与传递的一个不同。

DATA_S_SAMEFORMATETC

FORMATETC的结构相同,并且空在 formatOut 参数引用返回。

DV_E_LINDEX

lindex 有一个无效值;当前,只支持 -1。

DV_E_FORMATETC

formatIn 参数有一个无效值。

OLE_E_NOTRUNNING

应用程序未运行。

实现

IDataObject.GetCanonicalFormatEtc(FORMATETC%, FORMATETC%)

备注

此方法将调用委托给从 System.Runtime.InteropServices.ComTypes 命名空间的相应 GetCanonicalFormatEtc,假定,剪贴板对象包装现有 IDataObject

.NET Framework 安全性

请参见

参考

ClipboardObject 类

Microsoft.VisualStudio.Data.Framework 命名空间