Delphi records and c structs

Task:

An application written in Delphi takes the structure ( recordin Delphi terms) of three fields. I can send a pointer to this structure using a function SendMessage(Win32 API).

So the question is:

How to maintain a specific representation of the structure in memory for Delphi in terms of Delphi?

He has type

PWPModPostData = ^ TWPModPostData;
TWPModPostData = record
   DataType: Integer;
   Data: PChar;
   Next: PWPModPostData;
end;

How to define it in C? I mean, are there any hidden or utility fields in Delphi structures?

+3
source share
2 answers

No, there are no hidden fields, and Delphi entries and C structures can be mapped to each other 1: 1 with a few caveats:

  • - C . , Delphi.

  • C Delphi , - . , . .

  • C Delphi , make , , . .

+8

, , , , LPARAM SendMessage(), , . , .

Windows, WM_GETTEXT, , , , .

, WM_COPYDATA, .

, . WM_COPYDATA , . , , , , . , . , PChar .

Edit:

: , ; DLL, , DLL , , , DLL, . , , , .

+4

Source: https://habr.com/ru/post/1724895/


All Articles