This topic has not yet been rated - Rate this topic

GetBaseFileNameForConfiguration Method

Visual Studio .NET 2003

Returns the base file name of the referenced assembly for the given configuration.

[Visual Basic .NET]
Public Function GetBaseFileNameForConfiguration( _
   ByVal Config As Object _
) As String
[Visual Basic 6]
Function GetBaseFileNameForConfiguration( _
   ByVal Config As Object _
) As String
[C++]
HRESULT __stdcall GetBaseFileNameForConfiguration(
   IDispatch* Config,
   /* [out, retval] */ BSTR* retVal
);
[C#]
public string GetBaseFileNameForConfiguration(
   object Config
);
[JScript .NET]
public function GetBaseFileNameForConfiguration(
   Config : Object
) : String

Parameters

Config
An object representing the configuration.

Return Value

Returns a string representing the base file name of the referenced assembly for the given configuration.

Example

The following example lists the base file name of each referenced assembly for the configuration:

' Add a reference to Microsoft.VisualStudio.VCProjectEngine and have a 
' Visual C++ .NET project with references loaded before running this 
' example.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
   Sub Test()
        Dim proj As Project
        Dim vcproj As VCProject
        Dim ref As VCReference
        Dim axref As VCActiveXReference
        Dim cfgs As IVCCollection
        Dim cfg As VCConfiguration

        On Error Resume Next

        ' Get a reference for the project's configuration.
        cfgs = proj.Configurations
        cfg = cfgs.Item(1)
        ' Loop each project in the solution
        For Each proj In DTE.Solution.Projects
            vcproj = Nothing
            vcproj = CType(proj.Object, VCProject)
            ' If this project is a Visual C++.NET project
            If Not vcproj Is Nothing Then
                ' Loop the references for this Visual C++.NET project
                For Each ref In vcproj.VCReferences
                    axref = Nothing
                    axref = CType(ref, VCActiveXReference)
                    ' If this reference is an ActiveX reference
                    If Not axref Is Nothing Then
                        MsgBox("Base file name: " & _
                          axref.GetBaseFileNameForConfiguration(cfg))
                    End If
                Next
            End If
        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: VCActiveXReference Object | VCAssemblyReference Object | VCProjectReference Object | VCReference Object

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.