Export (0) Print
Expand All
Cut
Run
Expand Minimize
This topic has not yet been rated - Rate this topic

AddClass Method [Variant 1] (General Extensibility)

Visual Studio .NET 2003

Creates a new class code construct and inserts the code in the correct location.

Note   AddClass may not be supported by all languages. This method is not supported for Visual Basic .NET or Visual C# .NET.
[Visual Basic .NET]
Public Function AddClass( _
   Name As String, _
   Position As Variant, _
   Bases As Variant, _
   ImplementedInterfaces As Variant, _
   Optional Access As vsCMAccess = vsCMAccessDefault _
) As CodeClass
[Visual Basic 6]
Function AddClass( _
   Name As String, _
   Position As Variant, _
   Bases As Variant, _
   ImplementedInterfaces As Variant, _
   Optional Access As vsCMAccess = vsCMAccessDefault _
) As CodeClass
[C++]
HRESULT __stdcall AddClass(
   BSTR Name,
   VARIANT Position,
   VARIANT Bases,
   VARIANT ImplementedInterfaces,
   vsCMAccess Access,
   /* [out, retval] */ CodeClass** retVal
);
[C#]
CodeClass AddClass(
   string Name,
   object Position,
   object Bases,
   object ImplementedInterfaces,
   vsCMAccess Access
);
[JScript .NET]
public function AddClass(
   Name : String,
   Position : Object,
   Bases : Object,
   ImplementedInterfaces : Object,
   Access : vsCMAccess
) : CodeClass

Parameters

Name
Required. The name of the class.
Position
Optional. Default = 0. The code element after which to add the new element. If the value is a CodeElement, then the new element is added immediately after it.

If the value is Long, then AddClass indicates the element after which to add the new element.

Because collections begin their count at 1, passing 0 indicates that the new element should be placed at the beginning of the collection. A value of -1 means the element should be placed at the end.

Bases
Required. Default = 0. A Safe-Array of CodeClass objects from which the new class inherits its implementations.
ImplementedInterfaces
Required. Default = 0. A Safe-Array of CodeInterface objects, each representing an interface that the new class promises to implement.
Access
Optional. A vsCMAccess constant.

Return Value

Returns a CodeClass object.

Remarks

The correctness of the arguments is determined by the language behind the code model.

See Also

Applies To: CodeClass Object | CodeNameSpace Object | CodeStruct Object | FileCodeModel Object | VCCodeClass Object | VCCodeNamespace Object | VCCodeStruct Object | VCCodeUnion Object | VCFileCodeModel Object

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.