Solved

generating iids

Posted on 1998-11-10
4
293 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

691 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