tags:

views:

41

answers:

1

I have to use the windows.h file in my code but it conflicts with other legacy include files on my project that I can not modify. This is in c++. How do I get around this problem, since I can not modify any of the header files in question? I thought about using a namespace but I would think you can not wrap a include in a namespace because once you instantiate you will get the same problem and I would also think it's bad practice? My team leader said to make my header file more stand alone, but eventually I still need to use the windows header in my cpp file where I define my class, so I would think that won't work in the long run.

Thanks

+1  A: 

Thank you, my solution was to remove the windows.h file from the header and make everything generic, LPSTR, LPWSTR and even the HINSTANCE (made void* and cast back in cpp file). I guess the rest of my problem was just me being an idiot!

Dixon Steel
I'm glad that you managed to solve your problem on your own. Could you mark your own answer as solution then, to avoid this question being listed as not-answered?
S.C. Madsen
Thanks, sorry I am new to this.
Dixon Steel