+4  A: 

Hi Frank,

There are at least two ways to do this. The first is to simply include windows.h at the top of all your files. Then include winnt.h only if you need it. However, I find this a bit too much - I don't see the need of including all this goo in every single file.

What I do is this at the very top (first thing) in my C/C++ header files.

#ifndef __wtypes_h__
#include <wtypes.h>
#endif

#ifndef __WINDEF_
#include <windef.h>
#endif

This will get you you the data types, defines, and fundamental Windows API's. You may also need to add the following:

#ifndef _WINUSER_
#include <winuser.h>
#endif

#ifndef __RPC_H__
#include <rpc.h>
#endif

WinNT is a bit of a special animal - don't include it if including the above files works for you. If you do need it, include it after wtypes.h and `windef.h'

If this doesn't work, then check your include paths and predefined macros to see if those might be breaking your build.

Regards, Foredecker

Foredecker