VCCodeNamespace.Location[vsCMWhere] Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the location of the object declaration.
public:
property System::String ^ Location[Microsoft::VisualStudio::VCCodeModel::vsCMWhere] { System::String ^ get(Microsoft::VisualStudio::VCCodeModel::vsCMWhere Where); };
[System.Runtime.InteropServices.DispId(549)]
public string Location[Microsoft.VisualStudio.VCCodeModel.vsCMWhere Where = Microsoft.VisualStudio.VCCodeModel.vsCMWhere.vsCMWhereDefault] { [System.Runtime.InteropServices.DispId(549)] get; }
[<System.Runtime.InteropServices.DispId(549)>]
[<get: System.Runtime.InteropServices.DispId(549)>]
member this.Location(Microsoft.VisualStudio.VCCodeModel.vsCMWhere) : string
Public ReadOnly Property Location(Optional Where As vsCMWhere = Microsoft.VisualStudio.VCCodeModel.vsCMWhere.vsCMWhereDefault) As String
- Where
- vsCMWhere
Optional. A vsCMWhere value specifying whether the location of the declaration or the definition is returned.
The location of the object declaration.
- Attributes
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 How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.
Produkt | Versiounen |
---|---|
Visual Studio SDK | 2015, 2017, 2019, 2022 |