Seite 1 von 1

GUID Structure [erledigt]

Verfasst: Fr, 04. Dez 2015 12:35
von AUGE_OHR
hi,

ich habe Probleme mit "BYTE Data4[8]"
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx

Code: Alles auswählen

typedef struct _GUID {
  DWORD Data1;
  WORD  Data2;
  WORD  Data3;
  BYTE  Data4[8];
} GUID;
Members
Data1
Specifies the first 8 hexadecimal digits of the GUID.
Data2
Specifies the first group of 4 hexadecimal digits.
Data3
Specifies the second group of 4 hexadecimal digits.
Data4
Array of 8 bytes.
The first 2 bytes contain the third group of 4 hexadecimal digits.
The remaining 6 bytes contain the final 12 hexadecimal digits.
das sieht das in VS2015 so aus
MEMBER_GUID_Structure.jpg
MEMBER_GUID_Structure.jpg (102.77 KiB) 4060 mal betrachtet
ich habe nun den GUID String zerlegt und die einzelnen Array Element entsprechen dem Bild ... aber wie komme ich zu "BYTE Data4[8]" ?
anbei Testprogramm
GUIDSTRU.ZIP
(1.57 KiB) 269-mal heruntergeladen
Nachtrag : die GUID Structure ist in ot4xb enthalten ... #-o

Code: Alles auswählen

XB_BEGIN_STRUCTURE( GUID )
   _XBST_ULONG   ( Data1 )
   _XBST_WORD    ( Data2 )
   _XBST_WORD    ( Data3 )
   _XBST_BINSTR  ( Data4  , 8)
XB_END_STRUCTURE

Re: GUID Structure [erledigt]

Verfasst: Mo, 07. Dez 2015 12:16
von AUGE_OHR
im Demo ist die Zeile

Code: Alles auswählen

AADD(aRet,SUBSTR(cWork,27, 2))
doppelt vorhanden #-o
die 2nd Zeile muss

Code: Alles auswählen

AADD(aRet,SUBSTR(cWork,29, 2))
heissen, sorry

Code: Alles auswählen

FillGUID(@oGUID, cGUID )

PROCEDURE FillGUID(oGUID,cGUID)
LOCAL cHex
LOCAL aGuid := Guid2array(cGUID)

   oGUID:Data1 := nHex2Dw( aGuid[1] )
   oGUID:Data2 := nHex2W(  aGuid[2] )
   oGUID:Data3 := nHex2W(  aGuid[3] )
   cHex := aGuid[4] +;
           aGuid[5] +;
           aGuid[6] +;
           aGuid[7] +;
           aGuid[8] +;
           aGuid[9] +;
           aGuid[10]+;
           aGuid[11]
   oGUID:Data4 := cHex2Bin(cHex)
RETURN