Programming Windows D Examples are now Online!

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Jul 8 13:42:15 PDT 2011


Using std.c.windows.windows is going to be problematic because the
WindowsAPI bindings have a void* handle typedef, and
std.c.windows.windows has the same typedef.

If your library has this function:
foo(HDC hdc) { }

I can't use it from my code if I use the WindowsAPI bindings:

import win32.windef;
import win32.winuser;

{
   HDc hdc;
   foo(hdc);  // compile error
}

See:

test.d(21): Error: function test.Foo (HANDLE hdc) is not callable
using argument types (HANDLE)
test.d(21): Error: cannot implicitly convert expression (hdc) of type
HANDLE to HANDLE

Personally I wish we got totally rid of std.c.windows.windows and the
ancient DLLs distributed with DMD.


More information about the Digitalmars-d-announce mailing list