On Sunday, 30 June 2013 at 20:04:12 UTC, Anthony Goins wrote:
On Sunday, 30 June 2013 at 19:03:13 UTC, shuji wrote:
this code is in a .cpp file
//funcs.lib
//windows includes...
HWND hwnd;
int setHWND(HWND extHwnd){
        hwnd = extHwnd;
        return 0;
}

So im trying to import from D like this. I dont think I can implement this line in C++
extern (C++) {}

I'm probably the most unqualified person to offer help but are you sure you are linking with funcs.lib (assuming setHWND is defined there)

yes, i have called other functions in the same file correctly.

PD I can call a function with void* as receiving paremeter:
//main.d
extern (C++) {
        int setHWND(void* ehwnd);
}
//mylib.cpp
int setmyHWND(void* exthwnd){
        hwnd = (HWND)exthwnd;
        return 0;
}
and then cast on C++ to HWND, but I think it would be better to send the parameter correctly as HWND.

Reply via email to