Including a .h file in a .rc file?

Started by
4 comments, last by Spintwo 20 years, 6 months ago
In Lamoth''s TOTWGPG, Chapter 3, the part about resources, he tells you to make a .h file and include it in the .rc file. How do you do this? The way I did it was, I created a .rc file and then I open up the .h file that VC++ automatically creates. Then I delete all the extra crap in there and just put in my #defines. I don''t see how you could include a .h file into a .rc file.... Charles Hwang -Also/Previously known as Tazel Personal >>[MonkeyHumor-Under Developement | E-mail] Programming >>[NeXe|NeHe|SDL] Resource >>[Google|Dev-C++|GDArticles|C++.com|MSDN]
Advertisement
What Edition are you using. VC 5.0, which is TOTWETP 1st edition, doesn''t have the nice atuomagic .rc file generator.

~~~~~
"the best thing about betting on apathy is that even when you lose, you dont care." - nethead.
Download and play Slime King I.
~~~~~Screaming Statue Software. | OpenGL FontLibWhy does Data talk to the computer? Surely he's Wi-Fi enabled... - phaseburn
Version 6.0.

Charles Hwang -Also/Previously known as Tazel
Personal >>[MonkeyHumor-Under Developement|E-mail]
Programming >>[NeXe|NeHe|SDL]
Resource >>[Google|Dev-C++|GDArticles|C++.com|MSDN]
If it doesn''t automatically create and reference the .h file for you, do this:

1) create both the .h and .rc files and do the #defines, etc

2) at the top of the .rc file, put this line:
#include "YourHeaderFile.h" 

change the YourHeaderFile.h to what the .h''s filename really is.

That should work... but remember the .h can only have #defines in it. No code in either the .h linked by the .rc, or in the rc. (You may be able to put resource definitions in the h though..)
I not only know programming in Win32 in and out, I also do it that way.
Yeah, the problem is how, and where do you put the #include blah.h?? When I double click my .rc file, it turns into a folder and then has another folder which holds resources... There''s nowhere to type or anything in the .rc file. You can''t even import a .h file...

Charles Hwang -Also/Previously known as Tazel
Personal >>[MonkeyHumor-Under Developement|E-mail]
Programming >>[NeXe|NeHe|SDL]
Resource >>[Google|Dev-C++|GDArticles|C++.com|MSDN]
Anyone?

Charles Hwang -Also/Previously known as Tazel
Personal >>[MonkeyHumor-Under Developement|E-mail]
Programming >>[NeXe|NeHe|SDL]
Resource >>[Google|Dev-C++|GDArticles|C++.com|MSDN]

This topic is closed to new replies.

Advertisement