![]() |
Type record of byte, word - schaffe es nicht
Hi,
ich möchte diese Type von C auslesen:
Code:
In Delphi also:
typedef struct
{ uint8_t mytype; uint16_t address; uint16_t feature; uint8_t flags; } temp_DATA;
Delphi-Quellcode:
Per HidD_GetFeature lese ich dann die Daten.
type
TData = record mytype: UInt8; address: UInt16; feature: UInt16; flags: UInt8; end;
Delphi-Quellcode:
So ist aber das Ergebnis, dass type verschluckt wird und die restlichen bytes nach vorn geschoben werden.
THidD_SetGetFeature = function (HidDeviceObject: THandle; var Report; Size : Integer):LongBool; stdcall;
Wenn ich es so mache stimmt es:
Delphi-Quellcode:
Warum geht das nicht? :wiejetzt:
type
TData = record mytype: UInt8; address: Array[0..1] of UInt8; feature: Array[0..1] of UInt8; flags: UInt8; end; |
Re: Type record of byte, word - schaffe es nicht
Hast Du es mal mit packed record versucht?
|
Re: Type record of byte, word - schaffe es nicht
Danke!
Mit "packed" geht's! :cyclops: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:52 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz