tags:

views:

16

answers:

1

Hello.

I have a hird-party dll that need to be installed alongside with my app. In order to create a correct installer, all .dll files must have a LANGUAGE defined. Unfortunately, this third-party dll don't have a LANGUAGE :(. Is it any way to set a language for it without a recompilation? Maybe some command-line tool in Microsoft SDK?

+1  A: 

I don't know if there's a tool to do it, but you can write one yourself. See http://www.codeproject.com/KB/cpp/UpdateVersion.aspx

Here's the sample code:

HANDLE hResource = BeginUpdateResource(lpszFile, FALSE);
if (NULL != hResource)
{
    UINT uTemp;

    // get the language information
    if (VerQueryValue(lpBuffer,
                      _T("\\VarFileInfo\\Translation"),
                      (LPVOID *) &lpTranslate,
                      &uTemp) != FALSE)
    {
        // could probably just use LANG_NEUTRAL/SUBLANG_NEUTRAL
        if (UpdateResource(hResource,
                           RT_VERSION,
                           MAKEINTRESOURCE(VS_VERSION_INFO),
                           lpTranslate->wLanguage,
                           lpBuffer,
                           dwSize) != FALSE)
        {
            EndUpdateResource(hResource, FALSE);
        }
    }
}
Gabe