On Sun, 30 Jun 2013 20:24:17 +0200, shuji <cravs...@hotmail.com> wrote:


int setHWND(HWND extHwnd){
        hwnd = extHwnd;
        return 0;
}
And:

extern (C++) {
        int setHWND(HWND hwnd);
}


See how these are different? One of them is an extern (C++) function, the other is a D function.

In other words, this should work:

//funcs.lib
//windows includes...
HWND hwnd;
extern (C++) { // This line!
int setHWND(HWND extHwnd){
        hwnd = extHwnd;
        return 0;
}
}

//main.d
pragma(lib, "gdi32.lib");
import core.runtime;
import core.sys.windows.windows;
extern (C++) {
        int setHWND(HWND hwnd);
}
int main(int argc, char **argv) {
//windows initializers
        setHWND(hwnd);
        return 0;
}



--
Simen

Reply via email to