Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

generating iids

Posted on 1998-11-10
4
Medium Priority
?
305 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 80 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

604 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