Export (0) Print
Expand All
Expand Minimize

Culture Property

Visual Studio .NET 2003

Returns the culture for the selected reference.

[Visual Basic .NET]
Public ReadOnly Property Culture() As String
[Visual Basic 6]
Property Get Culture() As String
HRESULT __stdcall get_Culture(
   /* [out, retval] */ BSTR* retVal
public string Culture {get;}
[JScript .NET]
public function get Culture() : String

Return Value

Returns a enumResourceLangID value.


The following example code lists the Culture property value for each reference in the project:

' Add a reference to Microsoft.VisualStudio.VCProjectEngine.
' This sample will display the build number of every file 
' referenced in a Visual C++.NET project. Therefore, make sure 
' you have a Visual C++.NET project with references loaded before 
' running this code.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim proj As Project
        Dim vcproj As VCProject
        Dim ref As VCReference

        On Error Resume Next

        ' Loop each project in the solution
        For Each proj In DTE.Solution.Projects
            vcproj = Nothing
            vcproj = CType(proj.Object, VCProject)
            ' If this is a Visual C++.NET project
            If Not vcproj Is Nothing Then
                ' Loop each reference in the Visual C++.NET project
                For Each ref In vcproj.VCReferences
                    MsgBox("The culture for the file referenced by '" & _
                      ref.Name & "' is '" & ref.Culture & "'.")
            End If
    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

© 2014 Microsoft