VCFileCodeModel.AddIDLLibrary メソッド

library ステートメントを VCFileCodeModel オブジェクトの .idl ファイルに追加します。

名前空間 :  Microsoft.VisualStudio.VCCodeModel
アセンブリ :  Microsoft.VisualStudio.VCCodeModel (Microsoft.VisualStudio.VCCodeModel.dll 内)

構文

'宣言
Function AddIDLLibrary ( _
    Name As String, _
    Position As Object _
) As VCCodeIDLLibrary
'使用
Dim instance As VCFileCodeModel
Dim Name As String
Dim Position As Object
Dim returnValue As VCCodeIDLLibrary

returnValue = instance.AddIDLLibrary(Name, _
    Position)
VCCodeIDLLibrary AddIDLLibrary(
    string Name,
    Object Position
)
VCCodeIDLLibrary^ AddIDLLibrary(
    String^ Name, 
    Object^ Position
)
function AddIDLLibrary(
    Name : String, 
    Position : Object
) : VCCodeIDLLibrary

パラメータ

  • Name
    型 : System.String

    必ず指定します。新しいライブラリの名前を指定します。

  • Position
    型 : System.Object

    省略可能です。既定では 0 が指定されます。ここで指定したコード要素の後に、新しい要素を追加します。値が CodeElement の場合は、その値の直後に新しい要素が追加されます。

    コレクションのカウントは 1 から始まるため、0 を指定すると新しい要素がコレクションの最初に配置されます。値 -1 は要素を末尾に配置することを示します。

戻り値

型 : Microsoft.VisualStudio.VCCodeModel.VCCodeIDLLibrary

VCCodeIDLLibrary オブジェクト。

解説

この関数を呼び出すと、VCFileCodeModel オブジェクトの .idl ファイルに library ステートメントが挿入されます。

このサンプル コードをコンパイルして実行する方法については、「方法 : Visual C++ コード モデル機能拡張のプログラム例をコンパイルする」を参照してください。

この例は、vcFile の idl ファイルに library ステートメントを追加します。

Sub AddIDLLibrary()
    Dim vcFile as VCFileCodeModel
    vcFile = DTE.Solution.Item(1).ProjectItems.Item(1).FileCodeModel
    vcFile.AddIDLLibrary("MyLibrary")
End Sub

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

VCFileCodeModel インターフェイス

VCFileCodeModel メンバ

Microsoft.VisualStudio.VCCodeModel 名前空間