I've read and successfully tried the answer to How can I pass a Delphi string to a Prism DLL?, but wondered if it was possible to use a similar method to pass a Delphi array of integers (static or dynamic) to a Prism DLL.
A:
The simpliest (without marshalling) is to encode the array using BASE16 or BASE64 into a unicode string and pass a string.
Eugene Mayevski 'EldoS Corp
2010-09-09 13:53:47
A:
I don't have time to write a full working example but here are the key things to adapt the example you mention in the other question:
declare a type with your buffer length
type
[MarshalAs(UnmanagedType.LPArray)]
TBuffer = array[0..-length-]of integer;
and to make operations in the buffer remember to use the "pinned" modifier
var BufferPointer: ^TBuffer; pinned;
...
BufferPointer := @the_buffer[0];
someone
2010-09-09 17:29:43
Thanks. I'm useless at this an would really appreciate a full example if anyone has the time and willing. Your minutes will save me hours. Not in any rush.
Warren Stanley
2010-09-13 12:18:16