?
Solved

Hi,

Posted on 2002-05-06
6
Medium Priority
?
146 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 400 total points
ID: 6993819
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month16 days, 13 hours left to enroll

862 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