Archived

This topic is now archived and is closed to further replies.

Including a .h file in a .rc file?

This topic is 5173 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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..)

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites