ErosOlmi
19-12-2006, 17:19
I think I've got Delphi module development working with thinBasic strings. As you know thinBasic uses OLE32 strings while Delphi has many different string types but not OLE32 strings. Delphi AnsiStrings are the one that more a re closed to OLE32 but they differ in 4 bytes (number of reference count).
I need a confirmation I'm not able to find on the web, maybe too technical.
Anyhow, this is the problem:
Delphi AnsiStrings are in reality e pointer (p) to a DWord (pDW) that stores a pointer to a memory buffer (buff).
Buff than contains 2 DWORDs followed by the real string. The 2 DWORDs numbers are used for storing real string len plus number of reference to the string (number of pointers pointing to the same string)
I managed the whoole process in this way and it seems working fine both for getting and receiving string in/out from Delphi modules. And with strings of any len.
I would like to find a confirmation on some technical paper from Borland or from other sources.
If anyone have somethink, please let me know.
Thanks a lot
Eros
I need a confirmation I'm not able to find on the web, maybe too technical.
Anyhow, this is the problem:
Delphi AnsiStrings are in reality e pointer (p) to a DWord (pDW) that stores a pointer to a memory buffer (buff).
Buff than contains 2 DWORDs followed by the real string. The 2 DWORDs numbers are used for storing real string len plus number of reference to the string (number of pointers pointing to the same string)
I managed the whoole process in this way and it seems working fine both for getting and receiving string in/out from Delphi modules. And with strings of any len.
I would like to find a confirmation on some technical paper from Borland or from other sources.
If anyone have somethink, please let me know.
Thanks a lot
Eros