// William Payne
It's not a mystery! To find out, (if you're using Visual Studio) you
can right-click on HINSTANCE and "go to definition". (if you're using
some other IDE then you'll have to just search through the windows
include files until you find it).
This takes you to a line in windef.h,
DECLARE_HANDLE(HINSTANCE)
Again, "go to definition" of DECLARE_HANDLE takes you to winnt.h:
#ifdef STRICT
typedef void *HANDLE;
#define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef
struct name##__ *name
#else
typedef PVOID HANDLE;
#define DECLARE_HANDLE(name) typedef HANDLE name
#endif
typedef HANDLE *PHANDLE;
The 'strict' form uses a dummy struct purely for type-system
sneakiness, so that you can't assign one handle to another. That's why
you should always have 'STRICT' defined in your project settings!
--
Lucian
To a degree, you're wrong there. The construct used depends upon whether
STRICT has been #define'd (which is enabled by default, though I've never
seen in the project settings or the command line, so I define it
just-in-case).
When STRICT is not #define'd, you do end up with a void-pointer:
typedef HINSTANCE PVOID; // essentially
When STRICT has been #define'd, you get this:
struct HINSTANCE__
{
int unused;
};
typedef HINSTANCE__ * HINSTANCE;
Michael Winter
--
M.Winter@(I_hate_spam)blueyonder.co.uk
Remove "(I_hate_spam)" to reply.
"William Payne" <mikas493...@student.liu.se> wrote in message
news:bgn0hd$cte$1...@news.island.liu.se...