473,804 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to write GUID to register ?


Hallo,

I have to write a GUID to the register but I don't know to convert to
hexadecimal.
I have tried several things but I am shore that line 5 and 6 are not
correct.
//--------------------------------------------------------------------------
----------

if (RegCreateKeyEx (HKEY_LOCAL_MAC HINE,
L"SOFTWARE\\Mic rosoft\\MSMQ\\S impleClient\\" , 0, NULL, 0, 0, NULL, &hKey,
&disp)== ERROR_SUCCESS)

{

GUID pguid ; // 2
CSTUtil su; // 3
su.CoCreateGuid ( &pguid); // 4
char Myguid[50]; // 5 ??
sprintf( Myguid, "%#8x%#4x%#4x%s ", pguid.Data1, pguid.Data2,
pguid.Data3, pguid.Data4 ); // 6 ??
RegSetValueEx(h Key, L"fjkGUID", 0, REG_BINARY , (BYTE*)Myguid, 16 );
// 7

}

//--------------------------------------------------------------------------
------

Thanks ...
Frits Janse Kok
Jul 22 '05
10 3300
Dear David,

This code is working fine !!!
Thank you very much for every thing you did for me.
In the last days I have learned a lot of new C++ syntax.
For instance I did not know about str::string ( I allways used CString from
MFC ).
This weekend I will try to find some good C++ books.

Ones more : " thank you very much "

Greetings from The Netherlands, Europe
Frits Janse Kok
Jul 22 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
2361
by: Dave Anderson | last post by:
Consider the following: var GUID = Server.CreateObject("Scriptlet.TypeLib").GUID Let's assume GUID is {9A46FCC9-A7A1-4C96-9394-B1A966CEC081}. I happened to notice that if I concatenate this with any other string value, Response.Write aborts after the 38th character of the GUID (the closing brace):
1
3255
by: agrsaurabh | last post by:
Code Sample:- ATL Class class CAtl : public IA, Public IB
4
15657
by: Louis Frolio | last post by:
Greetings All, I have read many upon many articles here regarding GUID data types and uniqueness. There have been many opinions regarding the effectiveness of GUID's and when they should/should not be used. However, every article strongly implies, if it does not state it outright, that GUID's are always unique. My question is this, what happens if you have a database that uses GUID's and the NIC is changed out on the box? From what I...
5
6345
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid (pulled from sql server table with a data type of uniqueidentifier, originally taken from objectGUID from active directory domain)
2
4202
by: Lucas Tam | last post by:
Hi all, I'm using the command GetType(MyObject).GUID to return a GUID. Is the GUID a CRC type calculation on the object, or is it a pre-assigned value on the object? I was hoping to have a way to do a CRC type calculation on an object to see if it has changed or has been tampered with. Thanks.
2
1546
by: MR | last post by:
i am developing a client C# application that utilized a legacy COM object. For development, I cannot use the object because it has specific hardware requirements. Therefore i would like to write a stub or "emulator" for this COM object, preferably i C# but C++ or VB.NET would work too. The idea is to be able to use this object in development, then in production (when the hardware is available) just regsvr32 the "real" object and use that...
9
3966
by: Cylix | last post by:
The following is a c# code about using browser helper object(BHO) anyone know in VB.NET? public interface IObjectWithSite { int SetSite(object site); int GetSite(ref Guid guid, out IntPtr ppvSite);
2
2414
by: Ronald S. Cook | last post by:
Given that PenID is a Guid, is there a better way to write this? if (PenID.ToString() != "00000000-0000-0000-0000-000000000000") I thought I could do some sort of Guid.Empty check or something. Thanks, Ron
8
1148
by: Jonathan Wood | last post by:
Greetings, I often find myself writing public properties in my ASP.NET code and I need the ability to robustly handle cases where the property has not been set. So I often end up with code like this: public Guid PresenterID { get
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9593
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.