[DUG] LoadLibrary from resource?
Paul A Norman
paul.a.norman at gmail.com
Tue Mar 14 19:14:38 NZDT 2006
Thanks Trevor,
I guessed as much but hoped any way!
Paul
On 14/03/06, Trevor Jones <trevorj at ihug.co.nz> wrote:
>
> Paul,
>
> No you can't do this. It is a limitation imposed by the OS.
>
>
>
> When you call LoadLibrary, the OS maps the disk file that contains the
> dll into the process memory space. It doesn't necessarily load it into
> memory. When you try to access anything in the library ( the first time),
> it will generate a page fault and the OS will actually allocate RAM and
> really load the library (or parts thereof) into RAM.
>
>
>
> Effectively you have a memory to file mapping, and for that to work, the
> file must exist.
>
>
>
> It kinda sucks, but that is the way that Windows works.
>
>
>
> Trevor
>
>
> ------------------------------
>
> *From:* delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz]
> *On Behalf Of *Paul A Norman
> *Sent:* Tuesday, 14 March 2006 4:30 p.m.
> *To:* NZ Borland Developers Group - Delphi List
> *Subject:* [DUG] LoadLibrary from resource?
>
>
>
> Hi all,
>
>
>
> Is it possible to store a DLL in a RES and access it for loadLibrary()
> purposes, as a stream or something without having to save it to disk and
> access as per normal?
>
>
>
> Paul
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20060314/222065b4/attachment-0001.html
More information about the Delphi
mailing list