Interfacing C++ to create a Win GUI in D2

BLS nanali at nospam-wanadoo.fr
Tue Dec 4 13:46:20 PST 2007


Hi,
I am porting a huge C++ Windows GUI into D1. (no fun) But I wonder if it 
  is possible to keep the original C++ lib using D2's new extern (C++) 
feature. Advantage is that I have less trouble regarding the win header 
files, and I guess this approch will require less time.
BUT  I wonder how to manage the windows callbacks :

C++
BOOL CWnd::RegisterClassEx(WNDCLASSEX& wcx)
{
wcx.lpfnWndProc	= CWnd::StaticWindowProc;
....
if (!::RegisterClassEx(&wcx))
....
}

static LRESULT CALLBACK StaticWindowProc(HWND hWnd, UINT uMsg, WPARAM 
wParam, LPARAM lParam);

Of course this function has to be within the D code, because we need to 
manage the eventhandling.

Mission impossiple, good/bad idea, what do you think ?
Bjoern





More information about the Digitalmars-d mailing list