Forward declare HINSTANCE and friends

Posted by abenthy on Stack Overflow See other posts from Stack Overflow or by abenthy
Published on 2010-04-04T13:43:41Z Indexed on 2010/04/04 13:53 UTC
Read the original article Hit count: 262

Filed under:
|
|

Is there a way to forward-declare the HINSTANCE type from the WinAPI without including the full (and big) windows.h header?

For example, if I have a class RenderWindow which owns an HINSTANCE mInstance, i will have to include windows.h in RenderWindow.h. So everything that needs RenderWindow also has to include windows.h.

I tried including windef.h but this seems to need some things from windows.h. :-( If I can't forward declare it, is there at least a portable way to use something like long mInstance in RenderWindow instead of HINSTANCE?

© Stack Overflow or respective owner

Related posts about winapi

Related posts about c++