Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9217239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:35:39+00:00 2026-06-18T02:35:39+00:00

I am attempting to convert a string to a GUID using the function UuidFromString

  • 0

I am attempting to convert a string to a GUID using the function UuidFromString.

My Problem: The resulting GUID is not correct. When I go to compare the GUID using IsEqualGUID the function always returns zero when it should say that the 2 GUID’s are the same.

Take a look at this example that shows the error:

// NOTE: MONITOR_CLASS and MONITOR_CLASS_STR are EXACTLY the same GUID
//       except that one is in string version. When I convert the string
//       to a GUID then compare both of them, the comparison says they
//       AREN'T the same?? Whats going wrong? 
GUID id;
GUID MONITOR_CLASS       = { 0x4d36e96e, 0xe325, 0x11c3, { 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18 } };
LPTSTR MONITOR_CLASS_STR = L"4d36e96e-e325-11ce-bfc1-08002be10318";
UuidFromString((RPC_WSTR)MONITOR_CLASS_STR, &id);

_tprintf(_T("String: {%s}\nuID:    {%x-%x-%x-%2x%2x-%2x%2x%2x%2x%2x%2x}\n"), MONITOR_CLASS_STR, id.Data1, id.Data2, id.Data3, id.Data4[0],
     id.Data4[1], id.Data4[2], id.Data4[3], id.Data4[4], id.Data4[5], id.Data4[6], id.Data4[7]);


_tprintf(_T("IsEqualGUID: %d\n"), IsEqualGUID(id, MONITOR_CLASS));

The output is:

String: {4d36e96e-e325-11ce-bfc1-08002be10318}
uID: {4d36e96e-e325-11ce-bfc1- 8 02be1 318}
IsEqualGUID: 0

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:35:40+00:00Added an answer on June 18, 2026 at 2:35 am

    They are different: GUID MONITOR_CLASS has 0x11c3, whereas your _STR version has “11ce“.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to convert a string to a TStream. My code below gives me
I'm attempting to take an NSImage and convert it to a string which I
I am attempting to convert the following dict into JSON using json.dumps : {
I am attempting convert this string 2012-02-05T00:00:00+00:00 into a more attractive, nicely formatted string
I'm attempting to write a function that will take a string and create a
In the dev function below, I'm trying to convert the string to lowercase to
I'm attempting to convert Java code to C# but I'm running into a problem
I am attempting to create a variable or string from Convert.ToChar(b[i]) within the following
I'm attempting to convert a string from CP932 (aka Windows-31J) to utf8 in javascript.
I am attempting to convert a string into a number by summing the int

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.