VCCodeElement Object
Visual Studio .NET 2003
An object providing access to any code element within a source file.
[Visual Basic .NET]
Public Interface VCCodeElement Inherits IDispatch
[Visual Basic 6]
Class VCCodeElement
[C++]
interface VCCodeElement : IDispatch
[C#]
public interface VCCodeElement : IDispatch
[JScript .NET]
public interface VCCodeElement extends IDispatch
Remarks
The VCCodeElement object provides code model functionality to existing Visual C++ IDE solutions at the code element level. Primarily, this object is used to find and modify any code element (class declaration, identifier, function definition, and so on) accessible within a source file.
Note A large part of the functionality of this object is provided by the Visual Studio CodeElement object. For more information, see CodeElement object.
Requirements
Namespace: Microsoft.VisualStudio.VCCodeModel
File: vcpkg.dll
Example
This example assigns a newly-added class to a VCCodeElement object.
Sub GetVCCodeElement()
Dim vcCM As VCCodeModel
Dim vcCodeElement As VCCodeElement
vcCM = DTE.Solution.Item(1).CodeModel
vcCodeElement = vcCM.AddClass("MyClass", "MyClass.h")
End Sub
See Samples for Code Model Extensibility for information on how to compile and run this sample.
See Also
VCCodeElement Object Properties, Methods, and Events | VCCodeElements Collection | Visual C++ Extensibility Object Model