vb.net - Problem remaking com object after program has closed -


have been searching solution problem days no luck decided post here , hope can me. makes harder can't replicate problem on computer consistently. error of time won't.

basically happening creating ie object program controls long period of time. happening is, if user exits program calls oie.quit() closes program. should close internet explorer , processes associated it.

but, iexplorer process doesn't end closing. when user tries run program again error "system.runtime.interopservices.comexception (0x80004005): creating instance of com component clsid {0002df01-0000-0000-c000-000000000046} iclassfactory failed due following error: 80004005.".

to fix close iexplorer.exe processes open , let create our ie object again. happens if program crashes , try restart it.

i not sure causing or if missing has com objects. stuck.

here code although plugging in code won't reproduce errors:

'create ie object oie = new shdocvw.internetexplorer oie.navigate("http://www.google.com") oie.visible = false oie.silent = true  'kill ie object oie.quit() 

the exception hopeless, that's e_fail, "unspecified error". there isn't obvious reason why fail, starting instance of ie when program starts shouldn't problem. well, short ghost instances of ie keep running forever. guess got exception same reason ie didn't quit when called quit() last time.

do consider kind of mishap you'll create when program aborts , doesn't around cleanly shutting down ie. using environment.exit() quite unhealthy example. or other kind of nasty kaboom doesn't let finalizer thread run @ termination. maybe has happened many times before, ie refuses create more instances? how many instances have kill when need going again?

the better mousetrap here run ie in-process in own program rather out-of-process shdocvw. when program terminates, takes ie it. more efficient, there's lot of overhead involved in making out-of-process com server calls.

you using webbrowser in program.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -