Header Wrapper Symbol
-
Hi Guys I am a new comer to programming and this forum. I have been looking at some code I found on the internet and in the header files they have what i believe are called header wrappers. Which I understand are to stop the header file from being defined more than once. The code looks like this: #if !defined(AFX_MYDERIVATIVE_H__AC73BB0F_CC43_4B4B_850A_4DC13A664B8C__INCLUDED_) #define AFX_MYDERIVATIVE_H__AC73BB0F_CC43_4B4B_850A_4DC13A664B8C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "myFunction.h" namespace Ovalkey { //class definitions }; #endif My question is why the strange symbol AFX_MYDERIVATIVE_H__AC73BB0F_CC43_4B4B_850A_4DC13A664B8C__INCLUDED_ Is this something generated by Visual Studio? or just some strange thing the programmer decided to call the variable? Many thanks
-
Hi Guys I am a new comer to programming and this forum. I have been looking at some code I found on the internet and in the header files they have what i believe are called header wrappers. Which I understand are to stop the header file from being defined more than once. The code looks like this: #if !defined(AFX_MYDERIVATIVE_H__AC73BB0F_CC43_4B4B_850A_4DC13A664B8C__INCLUDED_) #define AFX_MYDERIVATIVE_H__AC73BB0F_CC43_4B4B_850A_4DC13A664B8C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "myFunction.h" namespace Ovalkey { //class definitions }; #endif My question is why the strange symbol AFX_MYDERIVATIVE_H__AC73BB0F_CC43_4B4B_850A_4DC13A664B8C__INCLUDED_ Is this something generated by Visual Studio? or just some strange thing the programmer decided to call the variable? Many thanks
This strange constant was generated by your friendly MFC Wizzard, when you used it to generate the Class Files. It is based on a GUID (Globally Unique Identifier). It's purpose is to ensure that this constant is unique in the world for your header. I.e. Someone else anywhere anytime who decides to generate a Class CMyDerivative, will have a different constant. :)
Bram van Kampen
-
Hi Guys I am a new comer to programming and this forum. I have been looking at some code I found on the internet and in the header files they have what i believe are called header wrappers. Which I understand are to stop the header file from being defined more than once. The code looks like this: #if !defined(AFX_MYDERIVATIVE_H__AC73BB0F_CC43_4B4B_850A_4DC13A664B8C__INCLUDED_) #define AFX_MYDERIVATIVE_H__AC73BB0F_CC43_4B4B_850A_4DC13A664B8C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "myFunction.h" namespace Ovalkey { //class definitions }; #endif My question is why the strange symbol AFX_MYDERIVATIVE_H__AC73BB0F_CC43_4B4B_850A_4DC13A664B8C__INCLUDED_ Is this something generated by Visual Studio? or just some strange thing the programmer decided to call the variable? Many thanks