Solved

generating iids

Posted on 1998-11-10
4
267 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 127
Separate files macro - Errors on larger data set 18 56
lucky13 challenge 11 112
modThree challenge 4 64
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now