On 2011-07-08 13:42, Andrej Mitrovic wrote:
> 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.

The situation betwen druntime and Phobos with regards to Windows-specific 
stuff definitely needs to be ironed out. The two conflict and at least some of 
the Phobos stuff for Windows isn't even under Boost. So, there's work to be 
done there. However, I don't believe that any Phobos developers are focusing 
on Windows-specific stuff like this at this point. So, if the situation is 
going to improve, someone is likely going to have to step up and do the work 
and then submit it for review. Otherwise, it's not likely to improve much 
anytime soon. Various pull requests from folks outside of the Phobos dev team 
have certainly helped, so progress is better than it was, but someone is 
probably going to have to take it upon themselves to sort it all out and 
propose and implement an appropriate solution for it to get fully fixed.

- Jonathan M Davis

Reply via email to