GUID Generator Dialog


This class can be included into any Qt project to cause a dialog window to be opened for the user to generate a GUID value.


This program is designed to emulate, exactly, the windows version of the guidgen.exe program. It produces the same basic results with a few added features, such as auto-clipboard copy, and uppercase/lowercase output.

My primary reason for producing this program was to produce a format output compatible with stamping the tops of header files with dual-include protection. My problem with implementing header include protection methods is automated build systems have been stealing my formats. Ok, maybe not mine, but in the past I was using a format similar to the following:

 #ifndef MYHEADER_H
 #define MYHEADER_H some stuff

But, one automated build system I was using suddenly, on an upgrade, happened to change to use that same format. I had similar file names, and ended up having a collision with their include protection naming scheme and mine. I have seen in the past, some naming conventions including a GUID value imbedded in the string value. Reluctantly I have resolved to adopt the same technique. My header include protection strings now look like the following:

 #ifndef MYHEADER_H_E963A104_7E3D_4CDA_A47EB01B433D67FD
 #define MYHEADER_H_E963A104_7E3D_4CDA_A47EB01B433D67FD some stuff

It may look like an overkill, but use it and you won't have to worry about somebody stomping on your include header protection.

The problem I had with using this format was the GUID string offered by the Microsoft version of guidgen.exe had to be reformatted by hand to get it to work. So, one lazy Saturday afternoon later and I've produced this.


~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Don't create Texas sized problems...
Comment your Code!
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC