Solved

generating iids

Posted on 1998-11-10
4
285 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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