Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. StringFromGUID2 under 64 bit Access 2010
  2. Public Declare Function StringFromGUID2 Lib "ole32.dll" _
  3.     (rclsid As GUID, ByVal lpsz As Long, ByVal cbMax As Long) As Long
  4.        
  5. Public Type GUID
  6. Data1 As Long
  7. Data2 As Integer
  8. Data3 As Integer
  9. Data4(7) As Byte
  10. End Type
  11.        
  12. Public Declare PtrSafe Function StringFromGUID2 Lib "ole32.dll" _
  13.     (rclsid As GUID, ByVal lpsz As Long, ByVal cbMax As Long) As Long
  14.        
  15. Dim rc As Long
  16. Dim stGuid As String
  17. ' 39 chars  for the GUID plus room for the Null char
  18. stGuid = String$(40, vbNullChar)
  19. rc = StringFromGUID2(rclsid, StrPtr(stGuid), Len(stGuid) - 1)