Ninjakreborn Posted July 19, 2009 Share Posted July 19, 2009 I have been practicing doing C++ Console (Command Line) applications for quite awhile. When I got my hands around the basics, I started dealing in the Win32 API. I have been using the: http://winprog.org/tutorial/menus.html I have some questions about these tutorials. First off on the resource file he uses stuff like: #define IDR_MYMENU 101 #define IDI_MYICON 201 #define ID_FILE_EXIT 9001 #define ID_STUFF_GO 9002 What I was wondering is....he mentioned that it was ID_whatever If I changed the word "ID" to something else would it work? Is that what it's suppose to be, or is that simply showing that you can use any word for the id? Also what are the numbers beside it? I don't get it. Those numbers listed beside each one. Quote Link to comment https://forums.phpfreaks.com/topic/166508-solved-general-c-questions-win32-api/ Share on other sites More sharing options...
Ninjakreborn Posted July 19, 2009 Author Share Posted July 19, 2009 Also, are you able to name the .rc file anything you want. Like what is better. Creating a resource file for everything, or creating a resource file for different things? My thoughts would be creating one .rc file for everything I need (dialogs, menus (however many), icons, anything else). Or should I create a different rc file for each item... like menu_one.rc, icon_one.rc, dialog_one.rc. I was thinking it would be a lot cleaner to have 1 .rc file for everything. I might have more questions but I will keep them all here in this one post, as to not cause clutter in the forums. Quote Link to comment https://forums.phpfreaks.com/topic/166508-solved-general-c-questions-win32-api/#findComment-878037 Share on other sites More sharing options...
Daniel0 Posted July 19, 2009 Share Posted July 19, 2009 Do you know what the preprocessor is? The lines starting with hash marks are what's called preprocessor directives. The preprocessor is run before the compiler. The #define directive defines a constant, so when the preprocessor runs it will, in this case, go through the source code and everywhere it finds IDR_MYMENU it will replace it with 101. Then the compiler will run. Quote Link to comment https://forums.phpfreaks.com/topic/166508-solved-general-c-questions-win32-api/#findComment-878066 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.