共用方式為


IVsUserData.SetData Method

Sets user data to a buffer.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

Syntax

'宣告
Function SetData ( _
    ByRef riidKey As Guid, _
    vtData As Object _
) As Integer
'用途
Dim instance As IVsUserData
Dim riidKey As Guid
Dim vtData As Object
Dim returnValue As Integer

returnValue = instance.SetData(riidKey, _
    vtData)
int SetData(
    ref Guid riidKey,
    Object vtData
)
int SetData(
    [InAttribute] Guid% riidKey, 
    [InAttribute] Object^ vtData
)
abstract SetData : 
        riidKey:Guid byref * 
        vtData:Object -> int 
function SetData(
    riidKey : Guid, 
    vtData : Object
) : int

Parameters

  • riidKey
    Type: System.Guid%
    [in] Unique identifier of the data.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsUserData::SetData(
   [in] REFGUID riidKey,
   [in] VARIANT vtData
);

A copy is made of the data, so the caller still owns the VARIANT being passed in.

.NET Framework Security

See Also

Reference

IVsUserData Interface

IVsUserData Members

Microsoft.VisualStudio.TextManager.Interop Namespace