Re: How use ShellExecute with a "RAM file"?
From: Arnaud Debaene (adebaene_at_club-internet.fr)
Date: 02/19/05
- Next message: Daniel Terhell: "Re: Registry Hive Questions"
- Previous message: Al Koch: "Re: How use ShellExecute with a "RAM file"?"
- In reply to: Al Koch: "Re: How use ShellExecute with a "RAM file"?"
- Next in thread: Al Koch: "Re: How use ShellExecute with a "RAM file"?"
- Reply: Al Koch: "Re: How use ShellExecute with a "RAM file"?"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 19 Feb 2005 07:59:36 +0100
Please don't top-post...
Al Koch wrote:
> Hi Gary,
>
> Thanks for the prompt reply (but I sure didn't want to get that
> particular answer!). I realize that an app like ShellExec() that is
> designed to "read a file" can't just be given a memory pointer, but
> the MFC CMemFile emulates a file and can be treated as such (at least
> by the application that has created the CMemFile)
This the whole point : the memory chunk managed by CMemFile is accessible
only in the process that created . For any other process, this pointer is
meaningless.
> Based on your reply, I have two follow on questions.
>
> 1) Would you possibly know if this is how IE works? When you click
> on a web site link in IE that corresponds to a file such as the types
> I mentioned (.doc, .xls, .jpg, .pdf, .wmv, ...) IE initially obtains
> the file in RAM (it's downloaded into the browser). Is IE always
> writing a temp file before it launches the associated app (such as
> Word, Acrobat, ...)?
Yes, the files are saved in the browser cache.
> I had hoped that IE was somehow able to
> accomplish what I want to do but it sounds as if even IE has to write
> a temp file 1st.
Yes. Read about processes address spaces separation to understand why.
>
> 2) If I can only launch ShelllExec() by 1st writing a temp file can
> you suggest how I can determine when the app that is launched has
> shutdown since that would be the earliest that I could safely delete
> the temp file?
WaitForSingleObject on the process handle.
Arnaud
MVP - VC
- Next message: Daniel Terhell: "Re: Registry Hive Questions"
- Previous message: Al Koch: "Re: How use ShellExecute with a "RAM file"?"
- In reply to: Al Koch: "Re: How use ShellExecute with a "RAM file"?"
- Next in thread: Al Koch: "Re: How use ShellExecute with a "RAM file"?"
- Reply: Al Koch: "Re: How use ShellExecute with a "RAM file"?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|