How to read a Delphi Array of Fixed Sized Strings within a packed record in c# -
I need to read a Blob field from the database in the AC # app.
Although the Blob field was written by the Delphi app in the database using the following method:
Process WriteABlob (Blob: Tibelfoffield; var buffer; size: integer); Var s: string; Settlethought (S, Size) started; This step (buffer, s [1], size); Blob.Value: = S; End;
The structure written to the database is not a simple structure and in this
microbial: string of array [0..3] [80];
Or worse, some of them include
MyRecord = 1 record byte: (iValue: integer;) 2: (cValue: char ;) End;
I am trying to read from the database in bytes and then
Marshal.PtrToStructure ()
To move it to the composition
My Structure is defined as:
[StructLayout (LayoutKind.Sequential, Charset = CharSet.Ansi, Pack = 1) ), Size = 10710)] Public structure Mibbffield {... [Marshall AS (unmanaged type. Bevalairere, ArreshType type = unmanaged type. ANCBSRR, Size Const = specific Z)] public string [] ArrayofFixedLengthStrings; ...}
But I get an error when calling Marshal. PtrToStructure ():
Marshall Field 'Arrayf Fixed Lambert String' type of 'MyBuffbild': Invalid management / unmanaged type combination (string [] to ArreshType type of LPSR, LPWRR, BST or LPTST
I was wondering if there was a feature that I would like to be a custom marshaller who would accept coupling with a string []
Also thought I content may include blob can read how in C #?
explained it ...
string to 20
Structure layout (LayoutCind.Secure, Charset = Charset Andy, Pack = 1)] Public Structure String 20 [[Marshall (UnmanagedType.U1)] Public Byte Strings; [Marshall (UnmanagedType.ByValTStr, SizeConst = 20)] Public string value; }
Apparently, string size identifier is only 1 byte at the beginning of a certain length string (i.e. Delphi shortstring), after which the definition of header_ identifiers was changed to:
[MarshallAge (unmanaged type. Bevalre, size cons = maximum_header_defined)] Public string 20 [] Header_organist;
It was also found that the Delphi packed boolean should be put in the form of
public boolean booleanwara [Marshall AS] (UnmanagedType.I1);
Comments
Post a Comment