This documentation is archived and is not being maintained.

Location Property

Visual Studio .NET 2003

Returns the location of the parent object declaration.

[Visual Basic .NET]
Public ReadOnly Property Location( _
   Optional ByVal Where As vsCMWhere = vsCMWhereDefault _
) As String
[Visual Basic 6]
Property Get Location( _
   Optional ByVal Where As vsCMWhere = vsCMWhereDefault _
) As String
[C++]
HRESULT __stdcall get_Location(
   vsCMWhere Where,
   /* [out, retval] */ BSTR* retVal
);
[C#]
public string Location(
   vsCMWhere Where
) {get;}
[JScript .NET]
public function get Location(
   Where : vsCMWhere
) : String

Parameters

Where
Optional. A vsCMWhere value specifying whether the location of the declaration or the definition is returned.

Example

This example displays the file containing the declaration for each top-level code element.

Sub DisplayLocation()
    Dim vcCM As VCCodeModel
    Dim vcCodeElement As VCCodeElement
    vcCM = DTE.Solution.Item(1).CodeModel
    For Each vcCodeElement In vcCM.CodeElements
        MsgBox(vcCodeElement.Name + " is declared in " + vcCodeElement.Location)
    Next
End Sub

See Visual C++ Code Model Samples for information on how to compile and run this sample.

See Also

Applies To: 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

Show: