Using delegate for WindowProc - possible ?

2011-12-28 Thread Tal
Can I do something like this : __ extern (Windows) LRESULT delegate (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) MyWinProcDelegate; this() { MyWinProcDelegate = Events; } extern (Windows) LRESULT Events (HWND

Is there a way to create an elegant class-member window-function?

2011-12-27 Thread Tal
The Window-Procedure in the Win32 API must be static \ global function since it cannot take a class-object (the this) parameter. One can of-course use workarounds like a hWnd-object dictionary and such. I wonder if D has a way to elegantly solve it, like create a tiny member function copy for

dmd linker (OPTLINK) gives Error 42: Symbol Undefined when using extern

2011-12-25 Thread Tal
Linking the following two files gives me a link-error: a.d: import std.stdio; extern (D) string test (); void main() { writeln(test()); readln(); } b.d: string test () {

Re: dmd linker (OPTLINK) gives Error 42: Symbol Undefined when using extern

2011-12-25 Thread Tal
I want to save the hInstance of WinMain so I would be able to use it later in some other module. So how do I accomplish that ?

Re: dmd linker (OPTLINK) gives Error 42: Symbol Undefined when using extern

2011-12-25 Thread Tal
I'm quite new to this language, could you please provide a short snippet of code to clarify ?