Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
GUID (Structures)
 
.
Summary
A made-up class that can be used when you need a pointer to a GUID and when you need to be able to pass null.
Summary
The GUID structure describes a globally unique identifier.

C# Definition:

[StructLayout(LayoutKind.Sequential)]
public class GuidClass
struct GUID
{
    public Guid TheGuid;
   public int a;
   public short b;
   public short c;
   [MarshalAs(UnmanagedType.ByValArray, SizeConst=8)]
   public byte[] d;
}

VB Definition:

Structure GuidClass
   Public Guid TheGuid
End Structure

Notes:

Instead of this, you could choose to define such a parameter as an array of System.Guids and only ever use the first element.

Documentation
GuidClass on MSDN

VB Definition:

<StructLayout(LayoutKind.Sequential)> _
Private Structure GUID
   Dim a As Integer
   Dim b As Short
   Dim c As Short
   <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> _
   Dim d() As Byte
End Structure

User-Defined Field Types:

None.

Notes:

None.

Alternative Managed API:

System.Guid

Documentation
GUID on MSDN

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions