Boost logo

Boost :

From: Emil Dotchevski (emil_at_[hidden])
Date: 2007-11-03 18:25:47


> Most (all?) msdn documentation pages say to include <windows.h> to
> access a part of the win32 api even if it is declared in a different
> header. I know that when targeting Windows Mobile 5 with VS2005 you get
> a horde of error messages if you try to include headers like <winuser.h>
> directly.
>
> Couldn't the definitions be changed to something like
>
> namespace windows_error
> {
> enum windows_error_code
> {
> success = 0,
> // These names and values are based on Windows winerror.h
> invalid_function = 1, //ERROR_INVALID_FUNCTION
> ...
> }
> }
>
> A bit more fragile but removes the dependency on winerror.h
>
> Or is this too evil?

Whether or not it's evil depends on how likely it is for these values
to change across the Windows family of OSes; I can speculate that they
do no vary. But I think that a separate header solution is preferable,
because the windows_error_code enum is windows-specific anway.

-- 
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk