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

  • Home
  • SEARCH
  • 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 8608589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:39:06+00:00 2026-06-12T03:39:06+00:00

I am new to C# and USB programming. I am having several issues with

  • 0

I am new to C# and USB programming. I am having several issues with it. I am not able to communicate with it.Here is how I am declaring GUID to get GUID. I am creating a new instance of GUID and then calling HidGuid to get Guid.Below are pInvoke methods for it.But how to verify GUID I am getting is valid/correct.Is there any way to convert this structure in to a string. If so, how. Let me know. Thanks.

private GUID MYguid = new GUID();
HidGuid();

public unsafe void CT_HidGuid()
// 1.Data1 = 1293833650
//Data2 = 61807
//Data3 = 4559
//data4 = 136 203 0 17 17 0 0 48
// hex values  4d1e55b2 f16f 11cf 7be03c74ac80
{                              
    HidD_GetHidGuid(ref MYguid);  
}
[DllImport("hid.dll", SetLastError = true)]
static extern unsafe void HidD_GetHidGuid(ref GUID lpHidGuid);

public unsafe struct GUID
{
    public int Data1;
    public System.UInt16 Data2;.
    public System.UInt16 Data3;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
    public byte[] data4; 
}
  • 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-12T03:39:07+00:00Added an answer on June 12, 2026 at 3:39 am

    Do you really need to use PInvoke to generate a GUID? Why no using Guid.NewGuid() method from System namespace?

    http://msdn.microsoft.com/en-us/library/system.guid.newguid.aspx

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

Sidebar

Related Questions

I am new in C programming Here i want to detect USB is inserted
I'm new in Android Programming. I'm trying to write an app that uses USB
I want to use a BroadcastReceiver to get permission to communicate with a USB
I'm new here. And I need help on applescript. Currently i'm using USB Modem
I'm new to PIC programming, and I'm ready to make a USB program so
Is there a way in Xul to get notifications of new USB devices plugged?
new here and new to jQuery. I've searched for an answer to my question/
New programmer here, I am trying to understand and break down this code below
New developer here,Im using the Custom Image Picker by ray wenderlich. But what I
I'm new to CE programming and I have a Marvel device PXA270 with Windows

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.