WindowsAPI - Problem with DECLARE_HANDLE definition

Vladimir Panteleev vladimir at thecybershadow.net
Sun Sep 8 19:00:02 PDT 2013


On Monday, 9 September 2013 at 01:25:00 UTC, Mike Parker wrote:
> On 9/9/2013 8:52 AM, Stewart Gordon wrote:
> >
> > What do people think we should do?
> >
>
> Eliminate declare handle and alias all HANDLE types to void*.

I think this is the lazy and shortsighted answer. Even the 
official Windows headers have a strict typing mode (the STRICT 
define), which is recommended for new applications:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa383731(v=vs.85).aspx

Most code would benefit from additional compile-time checks, as 
the number of places where a cast is required is small. Stewart 
is attempting to reduce this number even further by defining a 
handle type hierarchy, something which isn't possible in C but 
might be possible in D.


More information about the Digitalmars-d mailing list