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 432055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:02:11+00:00 2026-05-12T20:02:11+00:00

I have a GUID variable and I want to write inside a text file

  • 0

I have a GUID variable and I want to write inside a text file its value.
GUID definition is:

typedef struct _GUID {          // size is 16
    DWORD Data1;
    WORD   Data2;
    WORD   Data3;
    BYTE  Data4[8];
} GUID;

But I want to write its value like:

CA04046D-0000-0000-0000-504944564944

I observed that:

  • Data1 holds the decimal value for CA04046D
  • Data2 holds the decimal value for 0
  • Data3 holds the decimal value for next 0

But what about the others?

I have to interpret myself this values in order to get that output or is there a more direct method to print such a variable?

  • 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-05-12T20:02:11+00:00Added an answer on May 12, 2026 at 8:02 pm

    Use the StringFromCLSID function to convert it to a string

    e.g.:

    GUID guid;
    CoCreateGuid(&guid);
    
    OLECHAR* guidString;
    StringFromCLSID(guid, &guidString);
    
    // use guidString...
    
    // ensure memory is freed
    ::CoTaskMemFree(guidString);
    

    Also see the MSDN definition of a GUID for a description of data4, which is an array containing the last 8 bytes of the GUID

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

Sidebar

Related Questions

i have a guid value that i store in my hidden variable. say for
I am trying to access a shell variable inside a piped nawk. I have
i have a variable with this value 'a|mike||c|John||d|Pierre' (the a ,b and c are
I have a XML file with my data in it. I want to populate
I have the following jQuery Function. I'm trying to return the GUID value shown
I have a Guid.NewGuid() call that is creating an Empty Guid. What would cause
In my database, in one of the table I have a GUID column with
I have seen the GUID Collisons discussions but just wanted your thoughts on whether
I have the following code: Guid id = imageMetaData.ID; Data.LinqToSQL.Image dbImage = DBContext.Images.Where(x =>
I have a Datatable with Id(guid) and Name(string) columns. I traverse through the data

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.