Jump to content
  • Advertisement
Sign in to follow this  
crazy_andy

mfc / resources / header files / classes / dialogs

This topic is 4895 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

Ok, I'm kindof confused. I have a program with a fair amount of dialog boxes and I have one header file to define the classes for all these dialog boxes. and I have a cpp file with all the code in for the dialog boxes. Also I have another couple of header files and cpp files for different parts of the project. Anyway, at the top of some of the header files I have #if !defined(AFX_DIRECTORYTREE_H__20B59A5E_FBE6_4A1C_A6B7_FDC199FE74EC__INCLUDED_) #define AFX_DIRECTORYTREE_H__20B59A5E_FBE6_4A1C_A6B7_FDC199FE74EC__INCLUDED_ what does this mean? when ddo I use it? and how do I know what to have in another .h file

Share this post


Link to post
Share on other sites
Advertisement
That's to make sure the code in your header file is only included once. You should do that with all the header files you write. It only looks funky because it's generated by a computer. I usually do it in this format:

in the file header.h

#ifndef HEADER_H
#define HEADER_H

// Code here.

#endif




When you do this, you're safe from multiple definitions and such. Took me forever to figure this one out when I started programming.

Share this post


Link to post
Share on other sites
The numbers and other stuff are just to make the identifier unique.
Some compilers also support "#pramga once".

Shawn

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!