generating GUID reliably

Hi all,

In my MFC app I generate GUID using the CoCreateGuid() API function. This 
function is a wrapper of UuidCreate(). This function (CoCreateGuid()) failed 
on one of my customers PC. I suspect PC network card problem or something 
related.

My idea is that if CoCreateGuid() fails, I could generate the GUID using 
UuidCreateSequential(), which does not request network card. The problem is, 
that there is no wrapper for UuidCreateSequential(), so I do not knowhow to 
call it from c++.

Any ideas?

Thanks for reading
Vaclav


0
no1498 (362)
2/2/2006 9:32:46 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
613 Views

Similar Articles

[PageSpeed] 47

I really don't know if that is going to solve the problem. But here is how
to make the call.

BOOL GetGUID(GUID &lGUID)
{
   typedef VOID  (CALLBACK* PROC)(UUID*);
   RETVALUE  lReturnValue = SUCCESS;
   HINSTANCE  lLib;
   PROC   UuidCreateSequential;

   lLib = LoadLibrary("RPCRT4");

   if (lLib != NULL)
   {
      UuidCreateSequential = (PROC)
GetProcAddress(lLib,"UuidCreateSequential");

      if (UuidCreateSequential != NULL)
      {
       UuidCreateSequential(&lGUID);
      }
      else
      {
       return FALSE;
      }

      lResult = FreeLibrary(lLib);
   }
   else
   {
      return FALSE;
   }

   return TRUE;
}

AliR.

"Vaclav" <no@spam.please> wrote in message
news:uxPs1AEKGHA.2088@TK2MSFTNGP11.phx.gbl...
> Hi all,
>
> In my MFC app I generate GUID using the CoCreateGuid() API function. This
> function is a wrapper of UuidCreate(). This function (CoCreateGuid())
failed
> on one of my customers PC. I suspect PC network card problem or something
> related.
>
> My idea is that if CoCreateGuid() fails, I could generate the GUID using
> UuidCreateSequential(), which does not request network card. The problem
is,
> that there is no wrapper for UuidCreateSequential(), so I do not knowhow
to
> call it from c++.
>
> Any ideas?
>
> Thanks for reading
> Vaclav
>
>


0
AliR3470 (3236)
2/2/2006 10:00:37 PM
Cool, I will give it a try.

Thank you very much!
Vaclav

"AliR" <AliR@online.nospam> p�e v diskusn�m p��sp�vku 
news:9ivEf.6543$2O6.319@newssvr12.news.prodigy.com...
>I really don't know if that is going to solve the problem. But here is how
> to make the call.
>
> BOOL GetGUID(GUID &lGUID)
> {
>   typedef VOID  (CALLBACK* PROC)(UUID*);
>   RETVALUE  lReturnValue = SUCCESS;
>   HINSTANCE  lLib;
>   PROC   UuidCreateSequential;
>
>   lLib = LoadLibrary("RPCRT4");
>
>   if (lLib != NULL)
>   {
>      UuidCreateSequential = (PROC)
> GetProcAddress(lLib,"UuidCreateSequential");
>
>      if (UuidCreateSequential != NULL)
>      {
>       UuidCreateSequential(&lGUID);
>      }
>      else
>      {
>       return FALSE;
>      }
>
>      lResult = FreeLibrary(lLib);
>   }
>   else
>   {
>      return FALSE;
>   }
>
>   return TRUE;
> }
>
> AliR.
>
> "Vaclav" <no@spam.please> wrote in message
> news:uxPs1AEKGHA.2088@TK2MSFTNGP11.phx.gbl...
>> Hi all,
>>
>> In my MFC app I generate GUID using the CoCreateGuid() API function. This
>> function is a wrapper of UuidCreate(). This function (CoCreateGuid())
> failed
>> on one of my customers PC. I suspect PC network card problem or something
>> related.
>>
>> My idea is that if CoCreateGuid() fails, I could generate the GUID using
>> UuidCreateSequential(), which does not request network card. The problem
> is,
>> that there is no wrapper for UuidCreateSequential(), so I do not knowhow
> to
>> call it from c++.
>>
>> Any ideas?
>>
>> Thanks for reading
>> Vaclav
>>
>>
>
> 


0
no1498 (362)
2/2/2006 10:09:10 PM
Reply:

Similar Artilces:

Generating Auto-Acknowledgement emails
I am looking for a solution to send a response to people who email a particular address (support@company.com) confirming the message was received. I would also like to set it up so that the auto-ack message is sent only during non-business hours. I'm guessing this is an SMTP gateway product that I will have to setup, but if anyone knows of another product I would appreciate any knowledge transfer you have to offer. -Robin Try Exclaimer (www.exclaimer.com). -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: www.exchangepedia.com/blog -----------------------------------...

Automatically generate email message with timed send
I have a list of contacts that I want to send reminder emails to at scheduled times as per event times drawing from a spreadsheet. The following are fields in my spreadsheet. Name Email Subject Comment Schedule date/time How would I use the fields as source for my mail merge and the schedule date/time to "delay" sending the email? I haven't written a macro for a few years now and can't seem to remember anything. Any assistance is greatly appreciated. Steven ...

error message:outlook.exe has generated errors and will be closed by windows
Hi, I just got this message when I am opening outlook ":error message:outlook.exe has generated errors and will be closed by windows". I followed the article Q297010 but still getting this message when I open outlook. I also unistall Microsoft and then installed it back again but still I am getting this message. Any help is appreciated. Regards, August ...

smtp address generation problem
I have installed a new exchange 2003 in a sbs2003. I create my company's domain in receiptant policy in exchange 2003 system manager. Then it generate all the email address for all the existing user. Later, I create a new user and want to add a smtp address as company@company.com. It shows an error that it is already exist and cannot be created. Then I check the email address of all the users in AD users & computers. No one user this smtp address. Then I try to send an email to that address(company@company.com). I found it goes to administrator's email account. However, in t...

Ability to add the object GUID to email templates, workflow email
It would be nice if the accountid, contactid, opportunityid, etc were available when creating e-mail templates or creating an e-mail from workflow. This would be VERY helpful in creating hyperlinks to the account, contact, etc in the e-mail you are sending. c360 has an "Email Link" tool. However it doesn't work with workflow or email templates. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the ...

looking for free software to calculate composite reliability?
Hello, At your possible convenience, might anyone please kindly answer my question? Thank you very much. I need to calculate composite reliability for constructs (latent variables). I know some people calculate the composite reliability manually. I am wondering whether anyone might happen to know any free software (open resource) that can help calculate composite reliability? Thank you very much. Please take care Caroline Caroline, Post how the manual calc is done, and then we can help. I have no idea what you mean by composite reliability.... HTH, Bernie MS Excel MVP ...

Error: msaccess.exe has generated errors and will be closed by windows
Dear all, I get error mesage "msaccess.exe has generated errors and will be closed by windows" when preview report. I'm using Access 2000 and Windows 2000. Thanks. Regards, Vensia ...

Chart created in VB generates 2 additional meaningless series
After loading data into a worksheet I generate 3 separate charts on chartsheets. The first and third charts are generated as desired and the second chart looks okay but when I view the Source Data under Series I see that I have 2 additional series created. Series 1 references the named ranges for the X and Y values; Series 2 references a range of cells using range notation =B1:B100 for the Y Values with no X values defined; and Series 3 references Y Values of {1} with no X Values. The code I am using to create the chart and series is identical to that used for the other 2 charts as far as I c...

Help: Auto generation of ID number, delivery date
Dear friends, I would appreciate if you kindly help me to prepare an excel sheet with Auto generation of ID number, delivery date , once I select customer name and enter receive date. In sheet 2: I have already entered the customer name, ID no and delivery timeline. In sheet 1: If I select =93Name of the customer=94 from dropdown and enter the =93Receive date=94 I want three fields to be populated automatically: ID no, Delivery date and time remaining from today. To calculate days remaining from today, I used =3DIF(D4>TODAY(),D4-TODAY(),"") I need help to generate Customer ID ...

Unable to view XML content generated on-the-fly in IE 6.0
Programming Language: C++, XML Development Env: VS.net 2002 Platform Win2k, SP4 Browser: IE 6.0 XML Parser MSXML 4.0 --------------------------------------------- I have an XML file having around 1000 nodes under the root. Further, each node may have several children. However, I am only interested in displaying only one particular node, depending on the user choice, in IE. 1. So I have instantiated a IWebBrowser2* pBrowser interface and navigated to about:blank. Then I extracted the IHTMLDocument2* interface from it. 2. Then I parsed the XML file and located the particular node to be disp...

Spam generated from this forum?
Apologies for any ranting I may do here but does anyone else get reams of spam generated from this forum and if so, how do you deal with it? I posted one message to this list and, stupidly, put my email address in it. I've not mentioned this address anywhere else. Since posting my query I've had 0 responses either by email or posted on the forum but I have had between 40 and 70 spam emails per day! I'm convinced its from a web crawler harvisting my address from here. The spam is always one of two types: 1 - A failure to deliver notice (this is odd: why would a spammer s...

Generating numbers in order with excel PLEASE HELP
I looked all over the place and can not find my answer Here my project I have to create number string ab1000000 thre ab1500000 So in excel it was to look like this Ab1000000 Ab1000001 Ab1000002 Ab1000003 And so on all the way until ab1500000 Can anyone help m -- color192 ----------------------------------------------------------------------- color1928's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2573 View this thread: http://www.excelforum.com/showthread.php?threadid=39144 Its actually quite simple. Enter the first two numbers into the columns they go in....

Problem using XSD object code generator schema containing abstract elements and substitutionGroup
I am trying to generate the classes for an XSD schema using the Microsoft XSD Object Code Generator (XSDObjGen). I am having a schema that contains the definition of the following: 1. a complex type 'ExternalDestinationBaseComplexType' 2. abstract element 'ExternalDestinationDefinitionEntry' of type 'ExternalDestinationBaseComplexType' 3. two elements 'SAP' and 'Dir' of type ExternalDestinationBaseComplexType with substitutionGroup set to 'ExternalDestinationDefinitionEntry' 4. within the XML root tag defintion, an 'ExternalDestinations'...

Realexamquestions.com study guides are better than Testking.co.uk study guides
Realexamquestions.com study guides are better than Testking.co.uk study guides ...

GUID Data type
What is the GUID data type in MS access 2003? I need it to create SQL statements to SQL db. Thanks. -- Tom Perkins I Like MS Access You can use: - GUID in a DDL query statement; - dbGUID in DAO code; - adGUID in ADOX code. For a reference on the various names for the standard JET field types, see: Field type names at: http://allenbrowne.com/ser-49.html -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Tom Perkins Indy" <tperkins81@hotmail.co...

how to generate a polynomial regression graph with 90% CI?
How do I add a trend line with the 10th, 50th and 90th percentiles to a scattergram graph? Excel has no graphics option nor any worksheet function that will do this. LINEST will give the standard errors of regression coefficients, but not their covariances (which are needed to get the standard error of a fitted value). Your options are to either write your own polynomial regression function, or use a different package. R is a freely available http://www.r-project.org full-featured and widely used statistical package that is an open-source implementation of the S languaguage, that ca...

Please guide me
Hi, I have started learning excel few months back with the help of this community and the training material provided by microsoft. Now, I am capable of working on excel worksheet, formulas and functions. But according to my need this is not enough, I want to make excel more flexible for me, because there are still many works which I am not able to perform. After consulting with my freind I got to know that I can solve my problem after learning macros, but according to him to learn macro I have to learn visual basic from institute. I want to know, Is he right ? or not. If he is wrong ho...

E-mail System Generated
Hi, We have an e-mail in CRM that was sent to the Case Contact. The matching system generated e-mail shows that it was sent to several Contacts rather than the one Contact that it was originally sent to. To sum up, the original e-mail has one Contact in the To line and the system generated copy of the e-mail has several Contacts in the To line. Has anyone seen this type of error before? Thank you, Donna ...

How do I add vertical baseline guides in Publisher 2003?
I've been able to do it before but can't seem to be able/recall how to do it -- I thought there was an option under view - baseline guides...you could add horizontal and vertical. I only get baseline guides without any options and it'll put horizontal but not vertical. I've also tried the keyboard shortcut of ctl+shift+f7 and it doesn't work either. What am I doing wrong? You can add vertical ruler guides but not baseline guides. Arrange, ruler guides. Not sure why you would need vertical baseline guides. There is a vertical direction for text, if it isn't on you...

Auto generated backups
A few times now my database has closed itself due to error and create a backup. Each time I saved the backups I've added a number eg 1, 2, 3, 4 so it would allow me to save. Now I have 6 backup files from over the last few weeks. Do I need to keep them all? Or just the most recent one? How can I get the back up file just to refresh itself rather than having to create a new one each time. (as this takes up a lot of space). Any suggestions or explanations would be a great thanks! Rache Rachel This could be a Microsoft Access Lock File, check the File extension: .LDB When s...

High Availability Guide
Hi, Is there any paper/doc which describes a high available scenario for CRM 3.0 ? Something like clustered SQL, 2 or more domain controllers/global catalogs, and a "farm" for CRM IIS pages. Tks for any guidance. Luis Albero Try this. Microsoft Dynamics CRM 3.0 Suggested Hardware for Deployments up to 250 Concurrent Users http://www.microsoft.com/downloads/details.aspx?FamilyID=E835C764-AE63-4876-87DA-786464EE7269&displaylang=en "Luis Albero (luis_albero@terra.com.br)" <LuisAlberoluisalberoterracombr@discussions.microsoft.com> wrote in message news:4FACC...

CWnd isnt generating mousewheel events
Hi, I have a custom CWnd control, using VC6.0 I added a MouseWheel handler to the control afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); and a function body, BOOL CTab::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) { MessageBeep(0); return 0; } When I breakpoint MessageBeep(0), i see that it is not being called even when I mousewheel over the CWnd control. Is there anything else I need to do to handle these messages in my custom control. Thanks Carpii Make sure you have the following added to the BEGIN_MESSAGE_MAP(...) , END_MESSAGE_MAP() block. ON_WM_...

FRx: Generate reports automatically?
I have some reports created in FRx and GP that need to be created daily. Through a batch file and macro, I have the GP reports being published at 2:00 every morning. Does anyone know if it is possible to do something so that I could generate the FRx reports as well? Perhaps a batch file or something? Thanks FRx Report Server can do this. You need to talk to your partner to get pricing for it. -- Charles Allen, MVP "KJ" wrote: > I have some reports created in FRx and GP that need to be created > daily. Through a batch file and macro, I have the GP reports being >...

How to generate a form from an entry?
I hope I explain this correctly. I have a spreadsheet that merely is to record an entry instead of writing it in a paper form. For example: Entry #, customer, color#, Charge, Date. This is just to record the submission of a color chip to a vendor. THEN, we have to get an actual pre-pinted form and fill out all the same information, as well as some other info and fax it to our color vendor. The spreadsheet is just for us internally. What would be fantastic is, if after entering that line in Excel, somehow we would then be able to print the form that we have to fax, with all of the dat...

Generate Correlated variable to an existing data set
I would like to generate a column of random variables (-1 to 1) that are correlated to an existing column of values that are not -1 to 1. I know how to generate two sets of random correlated variables, but I can't seem to find a way to generate a column of random variables that is correlated to an existing column of numbers as opposed to one that was generated at the same time. It is probably something very simple or impossible, but I'm no stats expert and thus need help in identifying a function or formula that will allow me to do this. To be clear, I have a column of values rangin...