• Arrays and unmanaged code

    From Andy Gorman@1:229/426.52 to All on Sun May 9 21:36:15 2021
    I am trying to return an array from my newly functioning Delphi DLL. I know that I can't pass a dynamic array back but I'm running into getting the array pointer set to the right size (I keep getting buffer overruns). Does anyone have any small code snipets that can point me in the right direction?

    Thanks,
    Andy
    --- Mystic BBS v1.12 A47 2021/05/03 (Windows/64)
    * Origin: The Pot O'Gold - bbs.thepotogold.net:4888 (1:229/426.52)
  • From Anton Shepelev@2:221/6 to Andy Gorman on Thu Jun 24 19:20:02 2021
    Andy Gorman:

    I am trying to return an array from my newly functioning
    Delphi DLL. I know that I can't pass a dynamic array
    back but I'm running into getting the array pointer set
    to the right size (I keep getting buffer overruns).
    Does anyone have any small code snipets that can point
    me in the right direction?

    Could publish the prototype and specification for the DLL
    function that you are trying to write? If were doing it, I
    should pass the address of the first array element, because
    it would be also the start of the raw array data in memory.
    Of course, a sufficient number of elemnts would have to be
    pre-allolcatd in the calling code, and you can also pass
    that, to make sure the DLL does not try to write past the
    array boundary.

    ---
    * Origin: nntp://news.fidonet.fi (2:221/6.0)