troubleshooting Question

Adventures with "OleControl Shell.Explorer.2" deleting the temporary files issue.

Avatar of peterhupp
peterhuppFlag for Canada asked on
5 Comments2 Solutions1171 ViewsLast Modified:
ok, got my OleControl Shell.Explorer.2 activex control to work and it shows pdfs and graphics files.  But of course it needs a pdf file to exist so I create one.  I am storing the documents in my mssql database as a varchar(max)

So, when my user wants to view the document, I create a temporary file and ole.navigate2 to the file.  

But when I close the form, I want to delete the temporary file but of course it is in use.

So I navigate2 to "About:Blank" but I still have to wait .3 of a second before it is released.

delete file (tempfilename)

Tried a DOEVENTS but no difference.  I also have this after I navigate to the blank page:

DO WHILE (this.Olecontrol1.Busy OR this.Olecontrol1.ReadyState <> 4) 

but again, still need the delay.  So any ideas, not sure if the inkey(.3) is going to be enough for all my client's slow machines and it seems like a patch and not a solution.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros