Solved

Hi,

Posted on 2002-05-06
6
138 Views
Last Modified: 2010-05-02
On a system lots of dll's can be found. On systems that are default not english (like mine, it's dutch) dll's of different languages can be found.

Does anyone know of a way to get the language of each dll? I guess it's an api call or something because under w2k, the properties of a dll knows a tabpage called "version". In here also can be read the language of the dll.

Kind regards,

Ehout
0
Comment
Question by:ehout
  • 3
  • 3
6 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 6993786
I wrote a small application like that a short while ago:
http://www.soft-trax.com/www/downloads/OrderDLL.exe

Basically it is something like:
Private Declare Function GetFileVersionInfo Lib "Version.dll" Alias "GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwHandle As Long, ByVal dwLen As Long, lpData As Any) As Long
Private Declare Function GetFileVersionInfoSize Lib "Version.dll" Alias "GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, src As Long, ByVal length As Long)
Private Declare Function VerQueryValue Lib "Version.dll" Alias "VerQueryValueA" (pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As Any, puLen As Long) As Long
Private Declare Function VerLanguageName Lib "kernel32" Alias "VerLanguageNameA" (ByVal wLang As Long, ByVal szLang As String, ByVal nSize As Long) As Long

Private Function GetLanguage(ByVal sFile As String) As String
    Dim lDummy As Long
    Dim s as string * 50
    Dim sBuffer() As Byte
    Dim lBufferLen As Long, lVerPointer As Long
    Dim lVerBufferLen As Long
    Dim i As Integer
   
    'Attempt to retrieve version resource
    lBufferLen = GetFileVersionInfoSize(sFile, lDummy)
   
    If lBufferLen > 0 Then
        ReDim sBuffer(lBufferLen)
       
        If GetFileVersionInfo(sFile, 0&, lBufferLen, sBuffer(0)) <> 0 Then
            If VerQueryValue(sBuffer(0), "\VarFileInfo\Translation", lVerPointer, lVerBufferLen) <> 0 Then
                If (lVerBufferLen >= 4) Then
                    CopyMemory i, ByVal lVerPointer, 2
                    Call VerLanguageName(i, s, Len(s))
                    GetLanguage=s
                Else
                    GetLanguage = "N/A"
                End If
            End If
        End If
    End If
End Function
0
 
LVL 3

Author Comment

by:ehout
ID: 6993808
Hi,

Was curious, but the link is invalid?

Kind regards
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 100 total points
ID: 6993819
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 3

Author Comment

by:ehout
ID: 6993864
Thanx,

This was very helpful. I have been on the site too, That picture on the background, [quiet, bit shy voice] is that you? [back to normal voice].

However, The app is very basic. Do you provide the source for further development?

Kind regards.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6994235
Nope, that isn't me. I'm just another admirer ;-)

I would provide the source code if you can tell me the goals. If the application can be optimized by you I would be glad to give you the source code and see the eventual result!

CJ
0
 
LVL 3

Author Comment

by:ehout
ID: 6995695
OK, I'll contact you further by mail
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question