I use Gen field to hold doc, pdf, txt, xls and other types of
files in my VFP 7 applicaton.
I use ShellExecute to allow user to view them:
COPY MEMO attachbody TO (m.cFN)
declare integer ShellExecute in SHELL32.DLL ;
integer nWinHandle, string cOperation, ;
string cFileName, string cParameters, ;
string cDirectory, integer nShowWindow
nres = ShellExecute(0, 'Open', m.cFN, '', '', 1)
This creates temporary file in windows temp directory and opens windows
registered application (adobe acrobat, work, notepad, wordpad etc.) to view
it.
If user quits my application before quitting viewer application, those
temporary files remains in windows temp directory.
This causes a BIG security flaw.
I tried same thing in Outlook Express by opening message attachment.
In this case OE creates temporary file in Temporary Internet Files folder.
However, this file is deleted even if OE is exited before viewer application.
Any idea how to implement same thing in VFP ?
Andrus