lars
10-23-2009, 05:58 PM
I recently ported my app to delphi 2009 and everything looks fine until i fire the loadfromstream function then the app crashed.
i used the same code on delphi 2007 no problems here.
Does someone knows whats wrong with this code???:eek:
Stream.Read(J, SizeOf(J));
//Read the string
if Length(Buf) < J then
SetLength(Buf, J);
if J > 0 then
begin
Stream.Read(Buf, J);
SetString(UTF8St, PAnsiChar(Buf[0]), J);
st := UTF8ToString(UTF8St);
end
else
st := '';
if I = 1 then
t.Caption := st
else
t.SubItems.Add(st);
end;
end;
except
end;
end;
i used the same code on delphi 2007 no problems here.
Does someone knows whats wrong with this code???:eek:
Stream.Read(J, SizeOf(J));
//Read the string
if Length(Buf) < J then
SetLength(Buf, J);
if J > 0 then
begin
Stream.Read(Buf, J);
SetString(UTF8St, PAnsiChar(Buf[0]), J);
st := UTF8ToString(UTF8St);
end
else
st := '';
if I = 1 then
t.Caption := st
else
t.SubItems.Add(st);
end;
end;
except
end;
end;