Solved

generating iids

Posted on 1998-11-10
4
282 Views
Last Modified: 2013-11-20
I must generate a unique number each time my application runs.
It´s possible to have my application in running in different
computers.
My first thought was to work with the serial number but
my client may install an reinstall and so the generated number will repeat.
Does anyone has an idea?
Can i do it with something like the IID from COM?
How can i generate IIDs from my application?
0
Comment
Question by:jmartins71
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:Answers2000
ID: 1324463
How can i generate IIDs from my application?

UuidCreate

What else do you need to know ?
0
 

Author Comment

by:jmartins71
ID: 1324464
Thanks Answers2000

From your answer i have found
CoCreateGuid
"Creates a GUID, a unique 128-bit integer used for CLSIDs and interface identifiers."

What i need is to generate one unique number although my application maybe running in different computers (not connected)
at the same time (or not).

I think that CoCreateGuid is better?
Do you know any other method?

By the way i do not know if you have received my comment to an anterior question about hiding the help button in wizards.

Here is a copy of it.




"
"To remove the help button, set the flag in the m_psh member of your property sheet, before calling DoModal :-

oMySheet.m_psh.dwFlags &= ~PSH_HASHELP ; " 

it does not work!

From codeguru, i have seen one similiar solution that affects one flag in each property page.
But even this solution does not hide the button. It simple disable it.
I also try with ShowWindow but the ID i use for the help button (i think is IDHELP) crush the application.

Could you give me more details of your solution?
"

0
 
LVL 8

Accepted Solution

by:
Answers2000 earned 20 total points
ID: 1324465
As far as I can tell CoCreateGuid is basically the same as UuidCreate (it's a wrapper on it, I think).  Therefore it doesn't matter which you call.

The number generated will be unique every time, you do NOT have to worry about collisions.

UUID = Universally unique id
GUID = Global Unique id
UUID = GUID

The ID includes machine identification information (network address) plus date/time info.  You can therefore rely on 2 generated numbers NEVER being the same.

I'll go back to the other question, so any comments I might add will be in the right place.




0
 

Author Comment

by:jmartins71
ID: 1324466
Once again thanks Answers2000.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question