VCCodeModel インターフェイス

更新 : 2007 年 11 月

コンテナ内の任意のコード要素へのプロジェクト レベル アクセスを提供するオブジェクトです。

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

構文

'宣言
<GuidAttribute("DF69B05F-2447-11D7-8BF6-00B0D03DAA06")> _
Public Interface VCCodeModel _
    Implements CodeModel2
'使用
Dim instance As VCCodeModel
[GuidAttribute("DF69B05F-2447-11D7-8BF6-00B0D03DAA06")]
public interface VCCodeModel : CodeModel2
[GuidAttribute(L"DF69B05F-2447-11D7-8BF6-00B0D03DAA06")]
public interface class VCCodeModel : CodeModel2
public interface VCCodeModel extends CodeModel2

解説

VCCodeModel オブジェクトを使用すると、Visual Studio でサポートされている各言語 (Visual C++ を含む) で、コード モデル機能をプロジェクト レベルで使用できます。

このオブジェクトは、主として、(完全限定名の指定によって) プロジェクト内でアクセスできるコード要素を検索するために使用します。このオブジェクトは、プロジェクトの作成に使用されるプログラミング言語も指定します。

ms167684.alert_note(ja-jp,VS.90).gifメモ :

このオブジェクトの機能の大部分は、Visual Studio の CodeModel2 オブジェクトによって提供されます。

VCCodeModel オブジェクトをマネージ プロジェクトで使用する場合は、参照先となる Microsoft.VisualStudio.VCCodeModel.dll をインクルードします。マネージ プロジェクトに参照を追加する方法の詳細については、「方法 : Visual Studio で参照を追加または削除する (Visual Basic)」を参照してください。

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

この関数は、ソリューションの最初のプロジェクトを表す VCCodeModel オブジェクトを返します。

Function GetVCCodeModel() As VCCodeModel
    GetVCCodeModel = Nothing
    Dim codeModel As CodeModel
    Dim vcCodeModel As VCCodeModel
    Dim solution As Solution
    solution = DTE.Solution
    If (solution Is Nothing) Then
        MsgBox("A Solution is not open")
        Exit Function
    Else
        If (DTE.Solution.Count <> 0) Then
            codeModel = DTE.Solution.Item(1).CodeModel
            vcCodeModel = CType(codeModel, VCCodeModel)
            If (vcCodeModel Is Nothing) Then
                MsgBox("The first project is not a VC++ project.")
                Exit Function
            Else
                GetVCCodeModel = vcCodeModel
            End If
        End If
    End If
End Function

参照

参照

VCCodeModel メンバ

Microsoft.VisualStudio.VCCodeModel 名前空間