|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Assembly: Microsoft.VisualStudio.VCCodeModel (in microsoft.visualstudio.vccodemodel.dll)
[GuidAttribute("DF69B05F-2447-11D7-8BF6-00B0D03DAA06")] public interface VCCodeModel : CodeModel2
/** @attribute GuidAttribute("DF69B05F-2447-11D7-8BF6-00B0D03DAA06") */ public interface VCCodeModel extends CodeModel2
The VCCodeModel object provides code model functionality to various languages supported by Visual Studio (including Visual C++) at the project level.
Primarily, this object is used to find any code element accessible within a project (given a fully-qualified name). In addition, the object specifies the programming language in which the project is written.
A large part of the functionality of this object is provided by the Visual Studioobject.
When using a VCCodeModel object within a managed project, include Microsoft.VisualStudio.VCCodeModel.dll as a reference. For more information about adding references to a managed project, see.
Seefor information about how to compile and run this sample.
This function returns the VCCodeModel object representing the first project in a solution.
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