Sign in to follow this  

mfc / resources / header files / classes / dialogs

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
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.


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this