My app consists of this 6 files:
main.c - All necessary .hs are #included in it.
main.h - All global vars, HINSTANCES, HWNDS, etc. No #includes.
ini_io.h - ini_io functions and no #includes.
setcontrols.h - Some setfont stuff, no #includes.
resources.h - For the Ids, no #includes.
dialogs.rc - Off course, "resources.h" is included here. But i also HAVE to #include windows.h or else i cant compile my app. Once i #include it, everything runs smooth.
Ok, now tell me: Why the hell i got no problems having no #includes at ini_io.h for example (which uses windows.h, stdlib.h, stdio.h functions) and i have at dialogs.rc?
And what to do? windows.h is declared at two files (main.c and dialogs.rc)! Is it normal?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I also use the same includes in several files on big projects. I myself constider this normal. I do try to code in such a way to avoid having to do this, but what works, works, so I will not complain. Wayne, having a better understanding of C++ standards, will be able to answer your question form the compiliers point of view. But like I said, I do it, it works, so I consider it very normal.
Curtis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My app consists of this 6 files:
main.c - All necessary .hs are #included in it.
main.h - All global vars, HINSTANCES, HWNDS, etc. No #includes.
ini_io.h - ini_io functions and no #includes.
setcontrols.h - Some setfont stuff, no #includes.
resources.h - For the Ids, no #includes.
dialogs.rc - Off course, "resources.h" is included here. But i also HAVE to #include windows.h or else i cant compile my app. Once i #include it, everything runs smooth.
Ok, now tell me: Why the hell i got no problems having no #includes at ini_io.h for example (which uses windows.h, stdlib.h, stdio.h functions) and i have at dialogs.rc?
And what to do? windows.h is declared at two files (main.c and dialogs.rc)! Is it normal?
You should use #ifdef and #ifinclude
I also use the same includes in several files on big projects. I myself constider this normal. I do try to code in such a way to avoid having to do this, but what works, works, so I will not complain. Wayne, having a better understanding of C++ standards, will be able to answer your question form the compiliers point of view. But like I said, I do it, it works, so I consider it very normal.
Curtis