I have a header file(let's call it Window.h) that somewhat looks like this:
#include <windows.h>
class Window {
Window();
HWND hwnd;
}
To use this class in another file(for example Main.cpp), Window.h has to be included:
#include "Window.h"
The problem is that I don't want Main.cpp to include windows.h, since windows.h adds a lot of macros and new declarations outside of a namespace that I don't want to be in Main.cpp. I can't move windows.h to the implementation(Window.cpp) of Window.h, since the class has the HWND attribute.
The only workaround I could think about is to declare hwnd as a pointer:
void* hwnd;
But I don't like this approach. Things might get really messy if you do this a lot. Is there a better way to do this, maybe somehow "removing" declarations and macros from the Main.cpp file?