Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Internet Explorer Control keeps files open
Message
 
To
17/09/2004 05:01:23
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00943237
Message ID:
00943443
Views:
24
>We just built a file viewer user IE control and it works fine, except for a ennoying problem. The files are PDF or DOC and show normally in the control, but once a file has been displayed, it can't be deleted or renamed or moved. It seems there is a handle that keeps them open until we close the application. We made sure that the files are not displayed in the control before we try to move or delete them, but even after we close VFP, it takes 15 to 30 seconds before we can get access to them and delete them.
>
>Here is the code we use:
>
>
>...
>oIE.navigate(lcFile)
>
>... or
>oIE.navigate2(lcFile)
>...
>
>
>
>Does anyone know this problem?

Hi Christian,

From what I can tell, the problems with opening Acrobat and Word documents via IE (or WebBrowser control) are similar, but not quite the same. In either case, I think this is regarded as a "feature" of IE, intended to reduce the penalty of loading bloated apps repeatedly.

Acrobat seems to linger indefinitely, even after closing the instance of IE that was viewing the document. However, if you launch an instance of Acrobat (AcroRd32.exe) separately, and then close this instance, it will really go away completely, including the instance the was displaying in your WebBrowser. (This actually belongs to a single Acrobat process shared by both "instances".) If your WebBrowser is currently navigated to the Acrobat document, you'll get a dialog warning you of this fact when you try to close the separate Acrobat window. That dialog also has an option not to display again in future. If you navigate the WebBrowser to another page first, i.e. not an Acrobat document, there will be no such warning prompt, and closing the free-standing instance of Acrobat will really do the job. I believe this would eliminate the delays you're seeing with PDFs.

Forcing Word to close is a little different. If you close the instance of IE or WebBrowser that had the DOC open, this allows the corresponding Word process to die without further delay. You can see the behaviors I'm describing by watching what happens in the Processes tab of Windows Task Manager. I used an IE window for my tests, but I'll bet the behavior is the same with a WebBrowser control.

HTH

Mike
Montage

"Free at last..."
Previous
Reply
Map
View

Click here to load this message in the networking platform