Export (0) Print
Expand All
Expand Minimize

RelativePath Property (VCFile)

Visual Studio .NET 2003

Sets or returns the relative path to the file. This path must be relative to the project directory and can contain macros.

[Visual Basic .NET]
Public Property RelativePath() As String
[Visual Basic 6]
Property Get RelativePath() As String
Property Let RelativePath( _
   ByVal NewValue As String _
) 
[C++]
HRESULT __stdcall get_RelativePath(
   /* [out, retval] */ BSTR* retVal
);
HRESULT __stdcall put_RelativePath(
   /* [in] */ BSTR NewValue
);
[C#]
public string RelativePath {get; set;}
[JScript .NET]
public function get RelativePath() : String
public function set RelativePath(
   NewValue : String
)

Remarks

Any attempt to set the relative path of a file must result in a path that agrees with the FullPath property.

Example

The following sample code uses the RelativePath property in the development environment:

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim file As VCFile
        Dim col As IVCCollection
        Dim idx As Integer
        Dim prj As VCProject
        prj = DTE.Solution.Projects.Item(1).Object
        col = prj.Files
        For idx = 1 To col.Count
            file = col.Item(idx)
            MsgBox(file.RelativePath)
        Next
    End Sub
End Module

See Samples for Project Model Extensibility for information on how to compile and run this sample.

See Also

Applies To: VCFile Object

Show:
© 2014 Microsoft