how to generate uid for header files
-
Hi, How to generate this type of number in header files? #if !defined(AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_) #define AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_
-
Hi, How to generate this type of number in header files? #if !defined(AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_) #define AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_
They are usually generated automatically when you create a new class through the MFC wizard. On the other hand, you can perfectly attribute one yourself, usually the filename is used in someone (e.g. MYFILE_H). As long as the identifier is unique, its perfectly fine. You can also use the
#pragma once
directive which has been added in more recent compiler versions.Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++ -
Hi, How to generate this type of number in header files? #if !defined(AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_) #define AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_
To get new
GUID
s you've to useguidgen
tool, see here[^] for the steps required to run the tool from the Visual Studio IDE. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hi, How to generate this type of number in header files? #if !defined(AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_) #define AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_
The other replies must be good enough for you. Nevertheless, you can do this programmatically using APIs like
UuidCreate
,UuidCreateSequential
etc.«_Superman_»
I love work. It gives me something to do between weekends. -
Hi, How to generate this type of number in header files? #if !defined(AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_) #define AFX_COL_H__1C5B8C95_F2A0_424C_9CAB_CCF5E76B642E__INCLUDED_
-
The other replies must be good enough for you. Nevertheless, you can do this programmatically using APIs like
UuidCreate
,UuidCreateSequential
etc.«_Superman_»
I love work. It gives me something to do between weekends.Thank you! I thought there might be a way to generate the uid along with the header creation. In the above all replies we've to get uid separately and then append it to the header macro separately....