Zitat:
Welches Alignment hast du probiert? {$A1} , also packed ?
sorry habe vergessen wie man das Alignment zuweist. (Befehl von Delphi)
glaube das hatten wir schon mal.
Das andere werde ich ändern Danke.
Code:
TYPE STChannel
ID AS LONG
streamName AS ASCIIZ * %MAX_PATH
freq AS SINGLE
volume AS SINGLE
pan AS SINGLE
mute AS BYTE
solo AS BYTE
duration AS LONG
percent AS LONG
grouplevel AS SINGLE
led AS BYTE
rMeterValue AS SINGLE
reserved AS ASCIIZ * 25 '// Total 320 bytes.
END TYPE
EDIT:
Geänderte Teil
Delphi-Quellcode:
fHandle := CreateFile(PWideChar(sFile), GENERIC_READ, 0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (fHandle <> INVALID_HANDLE_VALUE) then
begin
FillChar(Channel, sizeof(TSTChannel) * MAXCHANNEL, 0);
BufferSize := sizeof(TSTChannel) * MAXCHANNEL;
FileSize := GetFileSize(fHandle, nil);
if (FileSize = INVALID_FILE_SIZE) then
FileSize := 0;
if (FileSize div sizeof(TSTChannel) = 8) then
BufferSize := FileSize;
if (FileSize < BufferSize) then
BufferSize := 0
else
bErrorFlag := ReadFile(fHandle, Channel[1], BufferSize, dwBytesReaden, nil);
CloseHandle(fHandle);
end;
Hab zwei shots angehängt.
Bei Packed ist der ganze Speicher verschoben.
gruss