On Wed, 01 Jun 2011 10:31:45 -0400, Lloyd Dupont <ld-rem...@galador.net> wrote:

I tried to add that to my D file
===
public import std.c.windows.windows;

extern(Windows)
{
    int GetUserDefaultLocaleName(LPWSTR lpLocaleName, int cchLocaleName);
}
===
and compile and link to kernel32.lib

But I got the following compile error:
Error 1 Error 42: Symbol Undefined _GetUserDefaultLocaleName@8 C:\Dev\DTest\DTest1\Dexperiment\

Any clues?

Typically, windows functions come in two varieties, the A and the W version. This is hidden by a macro in C, so all you ever call is GetUserDefaultLocaleName (and that's how it is in the docs even). But in D, which does not have a pre-processor, you must add the A (ascii) or W (wide) to the function name. Try:

extern(Windows)
{
    int GetUserDefaultLocaleNameW(LPWSTR lpLocaleName, int cchLocaleName);
}

-Steve

Reply via email to