This documentation is archived and is not being maintained.

CodeModel Property (General Extensibility)

Visual Studio .NET 2003

Returns the CodeModel Object for the project.

[Visual Basic .NET]
Public ReadOnly Property CodeModel() As CodeModel
[Visual Basic 6]
Property Get CodeModel() As CodeModel
HRESULT __stdcall get_CodeModel(
   /* [out, retval] */ CodeModel** retVal
CodeModel CodeModel {get;}
[JScript .NET]
public function get CodeModel() : CodeModel

Return Value

Returns a CodeModel object.


The CodeModel object gives you access to code elements or definitions in a source file.

Since CodeModel is most useful for Visual C++, other languages will find the FileCodeModel Property more suitable.


Sub CodeModelExample()
   Dim vcCM As VCCodeModel
   Dim vcCodeElement As VCCodeElement
   vcCM = DTE.Solution.Item(1).CodeModel
   vcCodeElement = vcCM.AddFunction("MyFunction", "File.h", vsCMFunction.vsCMFunctionFunction, "void")
End Sub

See Also

FileCodeModel Property

Applies To: Project Object | VCCodeAttribute Object | VCCodeBase Object | VCCodeClass Object | VCCodeDelegate Object | VCCodeElement Object | VCCodeEnum Object | VCCodeEvent Object | VCCodeFunction Object | VCCodeIDLCoClass Object | VCCodeIDLImport Object | VCCodeIDLImportLib Object | VCCodeIDLLibrary Object | VCCodeImport Object | VCCodeInclude Object | VCCodeInterface Object | VCCodeMacro Object | VCCodeMap Object | VCCodeMapEntry Object | VCCodeNamespace Object | VCCodeParameter Object | VCCodeProperty Object | VCCodeStruct Object | VCCodeTypedef Object | VCCodeUnion Object | VCCodeUsing Object | VCCodeVariable Object