How to send an ad HANDLE? (Win32)

How do I send an ad HANDLE ? I do not want to include all windows.h in this particular header.

+7
c ++ c winapi
source share
2 answers

The header, which is actually typedefs HANDLE , is winnt.h . Unfortunately, this is 15K lines here, so fixing your problem by including slimline windef.h bit misleading.

Here is the relevant part of my system (obviously, the details may change from revision to revision, but will not change at the implementation level, as this will violate existing binaries):

 // // Handle to an Object // #ifdef STRICT typedef void *HANDLE; #if 0 && (_MSC_VER > 1000) #define DECLARE_HANDLE(name) struct name##__; typedef struct name##__ *name #else #define DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name #endif #else typedef PVOID HANDLE; #define DECLARE_HANDLE(name) typedef HANDLE name #endif typedef HANDLE *PHANDLE; 

PS you need to love #if 0 in this Microsoft header shipping file.

+4
source share

Well, it seems I answered this myself. I just #include ed <windef.h> instead of <windows.h> now. I would still like to be able to forward the announcement only to HANDLE, if anyone has a way to do this.

+2
source share

All Articles