Click here to Skip to main content
15,889,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We are facing VB6 Activex control issue in multi-tab scenario of IE8.
System in context is a classic ASP web application. There are multiple VB6 ActiveX controls , which implements the UI. Classic ASP pages loads these VB6 ActiveX controls.

Problem scenario : Load one of such ASP page on one tab of IE8,immediately switch to another tab of IE8.
The Activex control fails on the previous tab. It throws an "invalid procedure called" error.
On debug we found that the actual method fails is SetFocus method of one of the control in ActiveX.

It looks like this is the problem with Windows handler, Activex control is looking for the control in the current active tab, and it fails to find the same.

Any solution,pointers would be helpful. Thanks .
Posted

The solution sounds rather obvious. Your code has to make sure that it finds the correct control before setting focus on it. If your code is looking at the current window, it shouldn't find the control, in which case, it should do nothing. It sounds like your code is assuming that control is always there and always visible.
 
Share this answer
 
Comments
Member 201298 23-Nov-10 2:33am    
Definitely SetFocus and not finding the control on the active tab is the problem. But avoiding set focus does not seems to be the solution. If we do not set focus while the ActiveX control is getting loaded ,then when should we do that? The problem is not just with SetFocus , but also with other API/methods which is trying to find the control on the active window.

One of the logical solution looks like when the web page is loading , very first thing , get the current window/tab handler. And then while loading the ActivX control pass that window handler, and let the Activex use that Window handler for rendering the controls and also for setting focus.
Are there any good references which demonstrates how to programatically get/use windows handlers for the ActiveX control and also how to programatically control Internet explorer V8 wndow/tab handling. Thanks
A problem you have is that you're assuming that the browser is the active window when your page loads. That's simply not the case. A user can start loading your page and switch windows to something else by the time your page loads and starts executing.

You cannot use the "current window" to look for controls. Why are you not using the normal VB6 method of:
TextBox1.SetFocus
 
Share this answer
 
Hi,
Even i work on Active X.
I am also facing the same issue of bringing a IE tab to focus with IE 8.
We were using IE 6 all the while and recently moved to IE 8.
For IE 6 EnumChildWindows API took care of traversing through IE tabs and getting the windows handler for all active windows. Since IE 6 was not mutlitabbed browser this issue never came up.
Is there any similar API for IE 8 or any multitabbed browser. Else any sample code or function which you can provide me so that this issue can be addressed
Any response will be of gr8 help!
Thanks,
Vidya
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900