N
nagar
On certain occasions I get COM exceptions errors when enumerating the
Windows Explorer active windows
Some customers reported the error
System.OutOfMemoryException: Retrieving the COM class factory for
component with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} failed due
to the following error: 8007000e.
Here's the code I use to retrieve the list of IE windows. Are there
better solutions that prevent the exceptions?
try {
SHDocVw.ShellWindows shell = new ShellWindowsClass();
int ihandle=handle.ToInt32();
foreach (InternetExplorer ie in shell) {
try {
if (ihandle == ie.HWND) {
path=ie.LocationURL;
}
}
catch (System.Runtime.InteropServices.COMException ex) {
}
catch (System.UnauthorizedAccessException ex) {
}
} catch (FileNotFoundException ex) {
}
catch (System.TypeLoadException ex) {
}
Windows Explorer active windows
Some customers reported the error
System.OutOfMemoryException: Retrieving the COM class factory for
component with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} failed due
to the following error: 8007000e.
Here's the code I use to retrieve the list of IE windows. Are there
better solutions that prevent the exceptions?
try {
SHDocVw.ShellWindows shell = new ShellWindowsClass();
int ihandle=handle.ToInt32();
foreach (InternetExplorer ie in shell) {
try {
if (ihandle == ie.HWND) {
path=ie.LocationURL;
}
}
catch (System.Runtime.InteropServices.COMException ex) {
}
catch (System.UnauthorizedAccessException ex) {
}
} catch (FileNotFoundException ex) {
}
catch (System.TypeLoadException ex) {
}