Delen via


Visual C++ Code Model

Visual Studio add-ins are deprecated in Visual Studio 2013. You should upgrade your add-ins to VSPackage extensions. For more information about upgrading, see FAQ: Converting Add-ins to VSPackage Extensions.

With this model, you can manipulate internal elements, such as a defined class or function, within a Visual C++ project.

The following objects are defined in the Visual C++ Code Model.

Object

Description

CodeModelEvents object.

An object providing access to various events fired by the Visual C++ Code Model.

MFCDialogNumberVariableExtender object.

An object providing access to the minimum and maximum range of a numeric-type variable in an MFC dialog box.

MFCDialogStringVariableExtender object.

An object providing access to the maximum character range of a string-type variable in an MFC dialog box.

MFCDialogVariableExtender object.

An object providing access to a variable code element in an existing MFC dialog box.

VCCodeAttribute object.

An object providing access to the attribute of an item.

VCCodeBase object.

An object providing access to the base class list of the parent object.

VCCodeClass object.

An object providing access to any class element collected in a VCCodeModel object.

VCCodeDelegate object.

An object representing a delegate code element (declared with the __delegate keyword).

VCCodeElement object.

An object providing access to any code element within a source file.

VCCodeElements collection.

A collection of objects (representing individual code elements) within one or more source files.

VCCodeEnum object.

An object representing an enumeration code element in the source code of a solution.

VCCodeEvent object.

An object representing an event code element (declared with the __event keyword).

VCCodeFunction object.

An object defining a function construct in a source file.

VCCodeIDLCoClass object.

An object defining a coclass element in a .idl file.

VCCodeIDLImport object.

An object defining an import element in an .idl file.

VCCodeIDLImportLib object.

An object defining an importlib element in an .idl file.

VCCodeIDLLibrary object.

An object defining a library element in an .idl file.

VCCodeImport object.

An object representing a #import code element in the source code of a solution.

VCCodeInclude object.

An object representing a #include code element in the source code of a solution.

VCCodeInterface object.

An object representing either a standard .idl interface, a dispinterface code element, or a code element (modified by the __interface keyword) in the source code of a solution.

VCCodeMacro object.

An object representing a macro (#define statement) code element in the source code of a solution.

VCCodeMap object.

An object representing a map code element in the source code of a solution.

VCCodeMapEntry object.

An object defining a map entry construct in a source file.

VCCodeModel object.

An object providing project level access to any contained code element.

VCCodeNamespace object.

An object representing a namespace element in the source code of a solution.

VCCodeParameter object.

An object representing a parameter of a function, property, and so on, in a source file.

VCCodeProperty object.

An object representing a property code element (declared with the __property keyword).

VCCodeStruct object.

An object representing a structure code element in the source code of a solution.

VCCodeTypedef object.

An object representing a typedef code element in the source code of a solution.

VCCodeUnion object.

An object representing a union code element in the source code of a solution.

VCCodeUsing object.

An object representing a #using Directive (C++) code element in the source code of a solution.

VCCodeVariable object.

An object representing a variable construct in a source file.

VCDialogExtender object.

An object providing access to an existing dialog box class in a solution.

VCFileCodeModel object.

An object representing the code elements in a source file.

VCLanguageManager object.

An object used to validate various code elements of a C++ source file.

Some properties and methods associated with these objects are defined as part of the larger Visual Studio model. However, even when the objects are similar to Visual Studio objects, there are additional properties or methods associated with them in Visual C++. For instance, while a function object has parameters associated with it in all the Visual Studio languages, in Visual C++ the function can have additional properties unique to the C++ language, such as being virtual, a constant, or part of an IDL file. These unique properties are exposed by the VCCodeFunction object. This is done so that you can work with properties unique to C++ from scripts within Visual C++.

To examine further topics in Visual C++ - specific code model, click on the links on the following table.

To

See

Generate and examine Visual C++ code by using a Visual Studio add-in written in Visual C#.

How to: Manipulate Code by Using the Visual C++ Code Model (Visual C#)

Generate and examine Visual C++ code by using a Visual Studio add-in written in Visual Basic.

How to: Manipulate Code by Using the Visual C++ Code Model (Visual Basic)

To examine the GUIDs used in implementing automation extenders thorough the Visual C++ code model.

Code Model Constants and Automation Extenders

See Also

Other Resources

Visual C++ Extensibility Object Model