kosovali
-
Content Count
7 -
Joined
-
Last visited
Posts posted by kosovali
-
-
14 minutes ago, DelphiUdIT said:There is not only a problem of the length of the "pointers" but also of the arrangement of the data within the record.
The compiler "fills" the record structure with zero bytes to align the data to the defined alignment (which can be the standard one or one defined in that section of code).
Therefore, the transmission of that data (whatever it is) is still at risk even if it were performed within programs made with Delphi. A change of alignment (even the standard one) for example between different platforms or different compiler releases could lead to different results.Used packed record.
-
1 minute ago, David Heffernan said:But what is the problem? You can't solve something until you know what the problem is.
As Lars says, streaming pointers seems, er, pointless.
Pointer fields updated in runtime. 30 years old codebase. Not created now. It is developed from pascal ide.
-
16 minutes ago, Lars Fosdal said:Why would you stream the pointers? They only have any meaning inside each application as a reference to a memory position.
Pointer fields updated in runtime.
-
Hi,
I have 1000+ records. This records contains pointer types. When records streamed on Win32 /Win64 has a different sizes. I want to use this records with win32/win64.
In Win32 Pointer size is 4, can be this size 8 bytes?
Or any other solutions?
type ptr_rec1=^rec1; rec1=record i1:integer; p1:Pointer; end; ptr_rec2=record rec:ptr_rec1; i:integer; p2:Pointer; end; SizeOf(ptr_rec2); //Different sizes for Win32/Win64
-
H.Alignment changes does not affected.
Sample output with DrawTextEx WinApi call :
procedure TForm1.Button1Click(Sender: TObject); var Text:String; lpRect:TRect; uFormat:Cardinal; Options: Longint; begin Text:= '123 SAMPLE 456'; lpRect:=Rect(10,10,300,150); uFormat:= {DT_LEFT or }DT_EXPANDTABS or DT_NOPREFIX or DT_RTLREADING; DrawTextEx(Canvas.Handle, @Text[1], Length(Text), lpRect, uFormat, nil); end;
-
İs possible same pointer size for Win32/Win64?
in Algorithms, Data Structures and Class Design
Posted
Records contains; Record Pointer, Double Link List Pointer. etc.
Element sequence is important.
Pointer values not important for streaming. Only used runtime.
We want to same format in the 64 bit app.
Fake32bitPtr can not be used with GetMem. Error: "Incompatible Types".
I can change -minimal- record fields for 64 bit compatibility.
Code changed for Win32/Win64 com.
But GetMem raised error.