Programming Windows D Examples are now Online!
bearophile
bearophileHUGS at lycos.com
Tue Jun 21 07:41:18 PDT 2011
Andrej Mitrovic:
> Everything else you need to know is in the Readme file:
> https://github.com/AndrejMitrovic/DWindowsProgramming
It looks like a lot of work!
I have not tried to compile the code yet.
I am not asking you to modify the code, but D with() was designed to reduce noise in code like:
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = &WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = cast(HBRUSH) GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = appName.toUTF16z;
wndclass.lpszClassName = appName.toUTF16z;
The code in those examples is generally very noisy (I presume about as much as the original code). I have mixed feelings about it.
Sometimes final switches are not easy to retrofit.
Bye,
bearophile
More information about the Digitalmars-d-announce
mailing list