mjwest
June 19th, 2009, 10:33 AM
I am using VB2008. I use the following code snippet within my code:
Dim oShellWindows As ShellWindowsClass
Dim browser As InternetExplorer
myLogger.Log("PopURL: Popping the URL = " & URL & ".")
oShellWindows = New ShellWindowsClass
myLogger.Log("Found " & oShellWindows.Count() & " instances of browsers.")
"myLogger.Log()" simply saves the string in a log file. This shouldn't affect anything.
This is running on an XP SP3 system (no Vista). The browser being used is IE7. Everything is fully patched.
Normally, the code works just fine. The users using this program *always* have lots of open IE windows. This normally returns the correct number of IE sessions that are open. (I then cycle through the windows to find the IE session with a particular URL.)
However, there are times when the Count returned is 0. I can sit at the user's station, look at all of the IE windows that really are currently opened, trigger this piece of code, and see the log file show that it returned a count of 0 in defiance of observable reality. The times when this occurs is intermittent, but when it occurs it is consistent and happens every single time the code is called. Note that there are no errors or exceptions when this happens. The code appears to process normally, but returns the wrong value.
Normally, if the user logs out of their session (thus completely shutting down all of the IE sessions) and logs in again, the problem goes away. But there have been a couple of times where that didn't even clear it up.
I am showing the code from VB2008, but the exact same code has been used in VB2005 (and equivalent code has been used in VC++ in 2005 and 2008, and in VB6) with the same results. So, the issue has nothing to do with the compiler used.
My belief at this point is that there is something screwy with their environment. However, what? What could cause the wholesale deregistration of every single browser session from ShellWindows without blowing up something else?
Dim oShellWindows As ShellWindowsClass
Dim browser As InternetExplorer
myLogger.Log("PopURL: Popping the URL = " & URL & ".")
oShellWindows = New ShellWindowsClass
myLogger.Log("Found " & oShellWindows.Count() & " instances of browsers.")
"myLogger.Log()" simply saves the string in a log file. This shouldn't affect anything.
This is running on an XP SP3 system (no Vista). The browser being used is IE7. Everything is fully patched.
Normally, the code works just fine. The users using this program *always* have lots of open IE windows. This normally returns the correct number of IE sessions that are open. (I then cycle through the windows to find the IE session with a particular URL.)
However, there are times when the Count returned is 0. I can sit at the user's station, look at all of the IE windows that really are currently opened, trigger this piece of code, and see the log file show that it returned a count of 0 in defiance of observable reality. The times when this occurs is intermittent, but when it occurs it is consistent and happens every single time the code is called. Note that there are no errors or exceptions when this happens. The code appears to process normally, but returns the wrong value.
Normally, if the user logs out of their session (thus completely shutting down all of the IE sessions) and logs in again, the problem goes away. But there have been a couple of times where that didn't even clear it up.
I am showing the code from VB2008, but the exact same code has been used in VB2005 (and equivalent code has been used in VC++ in 2005 and 2008, and in VB6) with the same results. So, the issue has nothing to do with the compiler used.
My belief at this point is that there is something screwy with their environment. However, what? What could cause the wholesale deregistration of every single browser session from ShellWindows without blowing up something else?