Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2008 Feb : Can a memory mapped file be used like a standard disc file?

www.cryer.info
Managed Newsgroup Archive

Can a memory mapped file be used like a standard disc file?

Subject:Can a memory mapped file be used like a standard disc file?
Posted by:"Enquiring Mind" (enquiring.mind@nospam.btopenworld.com)
Date:Fri, 1 Feb 2008 12:01:08

Hi,

Further to my recent post in the delphi.oleautomation NG about using COM
servers to view PDF documents, I have been unable to get any COM server to
work other than the PDF ActiveX control. When installed, this becomes
wrapped in the TPDF component. It appears that to get PDF data into this
control one can only use the method:

  function TPDF.LoadFile(const fileName: WideString): WordBool;

Now if the PDF data does not reside in a disc file but in a memory-resident
dynamic byte array, one needs to transfer the data to a temporary
intermediary file, then pass the file's name to the above method. This can
be quite slow for large PDF files if the temporary file is a disc file.

I was wondering whether it might be possible to make the intermediary file a
memory-resident file (e.g. a memory mapped file), and if so what file name
could be used to identify such a file. When a MMF is created one furnishes a
string identifier. Could this be used as a filename for the data in the MMF?

Regards,

EM

Replies:

www.cryer.info
Managed Newsgroup Archive