Board index » delphi » Read contents of array in DLL?

Read contents of array in DLL?

*** post for FREE via your newsreader at post.newsfeeds.com ***

Hello all,

I have a DLL with a constant array (see below for an example) - how can I
read the contents of this array in my app?

Example:
ARec = record
  Blah : PChar;
  Stuff : integer;
end;
...
const
  SomeArray : array [0..1] of ARec = ((Blah : 'test'; Stuff : 5), (Blah :
'test2'; Stuff : 200));

Thanks,

Bryan Ashby

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 90,000 Newsgroups - 16 Different Servers! =-----

 

Re:Read contents of array in DLL?


Send the pointer of the array to the application.

Keep in mind that the part that allocates data, should also free it. if you
unload you DLL the array will be freed (this can result in AV errors)

--
Met vriendelijke groet,

Ivar Snaaijer
_______________________________
Iris Huisstijlautomatisering BV
P.O.Box 355
2950AJ  Alblasserdam
The Netherlands

Tel: +31 78 699 29 00
Fax: +31 78 699 09 81
http://www.iris-hsa.nl
mailto:I.Snaai...@iris-hsa.nl
"Bryan Ashby" <bas...@iaccess.com> schreef in bericht
news:3b4a2a0d$1@post.newsfeeds.com...

Quote
> *** post for FREE via your newsreader at post.newsfeeds.com ***

> Hello all,

> I have a DLL with a constant array (see below for an example) - how can I
> read the contents of this array in my app?

> Example:
> ARec = record
>   Blah : PChar;
>   Stuff : integer;
> end;
> ...
> const
>   SomeArray : array [0..1] of ARec = ((Blah : 'test'; Stuff : 5), (Blah :
> 'test2'; Stuff : 200));

> Thanks,

> Bryan Ashby

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 90,000 Newsgroups - 16 Different Servers! =-----

Other Threads