Johnny Kauffman

Our product is suffering some pretty severe problems because of IE7. We've starting getting calls that dialog windows become hidden. We've heard this is a threading issue. We found out that the problem is actually much worse.

Modal dialogs don't seem to function correctly in IE7. You can recreate the problem using VB6 by doing this:

1. Create an ActiveX UserControl project.

2. Add a form to the project (form1)

2. Put a button on the user control (usercontrol1).

3. Add this code to usercontrol1.

Private Sub Command1_Click()

Dim objForm As Form1

Set objForm = New Form1
Call objForm.Show(vbModal)

End Sub

4. Build the project as an OCX somewhere on your hard drive.

5. Find your control's CLSID in regedit. It is the default value in

HKEY_CLASSES_ROOT\Project1.UserControl1\Clsid

6. Create an HTML file with this code. Replace the CLSID GUID with the one identified in step 5.

<HTML>
<BODY>
<OBJECT classid="CLSID:{95ED95BA-9ECB-4D15-91AE-A7809742B65A}"></OBJECT>
</BODY>
</HTML>

7. You can open the HTML file normally or host it in IIS if you want to get around some default security bubbles.

8. Press the button! Press it again and again!


Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

Johnny Kauffman

Here are some key points towards working around the problem.

1. With the above example, the problem does not present itself if you change the threading model from "Apartment Threaded" to "Single Threaded". This works in both IE6 and IE7 so far. I'll bet this fixes a lot of people's problems.

2. Behavior is slightly different between specifying

Call objForm.Show(vbModal)

and

Call objForm.Show(vbModal, Me)

In IE6, the top Show method is more susceptible to modal dialogs being stuck behind the Internet Explorer window. It only occurs when the dialog is in a different project than the control, however. We're not sure about IE7 entirely yet.

Unfortunately, if we set all items in our product to single threaded, it crashes IE7. So, we're still in a rut. Meanwhile, I fight back the urge to complain about IE7 in all caps.






Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

insta

Johnny, I think you mean that the bottom method (using Me as a second parameter) is the problematic one. To elaborate on your crashing comment, as we found in testing, the following steps will crash IE7:

* Create a new UserControl in VB6, and add a Form to the project
* Add a button to the UserControl
* In the button's Click event, show the form [Dim f As Form1 / Set f = New Form1 / Call f.Show(vbModal)]
* Load the UserControl in IE7 using Johnny's method above
* Click the button to spawn the form
* Get focus back to IE7 (right clicking on the taskbar icon will do it)
* Press ALT and navigate to the View menu, and select Refresh
* The modal window should disappear as the control is reloaded. If it doesn't, dismiss the modal window
* Navigate the browser to another page

IE7 should crash, trapped by the Error Reporting crash handler. I am of the opinion that this is an IE7 issue, rather than a VB6 one. Unfortunately I don't know another language well enough to try. The behavior doesn't happen in IE6.






Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

Rickard75


Great work Johnny! (both for starting this new, dedicated thread and for finding out that this might be a threading-issue).

We shall certainly try changing our active x-controls to single threaded and see what happens. I'll report back as soon as we find the time to try this. We have convinced the organization (our customer) that uses our application to block users from installing IE7, so we have bought us some time to fix this issue :)

In the meanwhile it would be nice with some official Microsoft-reply to this issue. Are they looking into it Do they see this as an issue at all

/Rickard




Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

Johnny Kauffman

I've got a little more bad news:

We thought using objForm.Show (vbModal) would screw up the form's position on the screen if it needed to show up "CenterOwner". We figured we didn't have to worry about it because we're using "CenterScreen". However, IE7 does not seem to support CenterScreen correctly either! IE7 will use CenterOwner, even if you supply the owner when showing the form. You can get it to show CenterScreen if you have Project1 reference Project2 and let Project2 show the form while supplying the owner. This has problems of its own too, though that I'll explain in the next post.






Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

Johnny Kauffman

Here's the next problem other people might face. We have over 20 VB projects in our product, which means OCX's utilizing other OCX's and DLL's, etc. There are some pretty bad problems surrounding this as well.

I noticed in other threads people are experiencing a problem with modal dialogs going behind the IE window in both IE6 and IE7. This can occur if you have more than one project.

1. Create Project1 (OCX), invisible at run time, and have a public method show a Form using .Show (vbModal, Me). Compile this project.

2. Create Project2 (OCX), reference Project1, and have a button call the public method described in step 1. Compile this project.

3. Start an IE window hosting the Project2 OCX, and press the button (which should show your form).

4. There are many ways to hide the modal dialog. The easiest I've found is to click twice on the IE window in the taskbar. This will hide the window behind IE. The only way to get back to your modal window is to Alt+Tab.

The solution we've found is to specify .Show(vbModal) without the Me designation. This works in both IE6 and IE7.






Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

Johnny Kauffman

Yet another problem. This is IE7 specific.

1. Create an OCX project that shows a Form using a Button. Compile it.

2. Open an IE7 window.

3. Use File-> New Window (an action I perform many times in a given day)

4. Navigate to the HTML file that hosts your project's OCX file.

5. Click the button.

6. Close the form.

7. Your original IE7 window will now get focus and move to the front of the screen.

This one me stumped. I could not solve this problem. However, it is only IE7 specific. These bugs are really starting to get to me; I feel like a beta tester when all I'm trying to do is make our product work.

I've contacted Microsoft IE7 developer support about the main modal dialog issue and recieved a case number. I'll keep this thread updated with the progress.






Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

Johnny Kauffman

One of the VB developers from Microsoft tells me they know about this issue and are planning at hotfix for it. The fix is tentatively planned for about two weeks from now, so it sounds like we'll have something to include in our installation mid-december.

They gave me a private build of the hotfix (that they asked me not to distribute), and I'm happy to announce that it fixes the modal dialog problem! This private build of the fix still has issues with windows being stuck behind the IE window, but they're intending to resolve that before they release the official hotfix.

I was not expecting this, but the hotfix I recieved involves only a change to the visual basic runtimes (MSVBVM60.DLL). Because of this, the hotfix installation will require that all visual basic applications are not running.






Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

stefanluchian

One of our users has found a workaround:

If you minimize the parent window, then you have access to the modal window and you can operate it.

This works at least for our OCX.

So, we could at least advise the users to search for the lost modal windows and to use them. It is not nice, but at least we could use our OCXs till Microsoft comes with a hotfix.





Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

richepk

Has MS given any further update to you on when the hotfix will be available



Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

richepk

has the hotfix been released



Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

2Tricky

I was told the same as Johnny and received the private hotfix (again I was told not to release to anyone) and so can confirm that the fix works.

I have since been told that the hotfix has been delayed as it encountered a different problem. As soon as they've solved that they said the hotfix release would be made public.

Unfortunately that was over 3 weeks ago. I'm still receiving updates, but thet are all saying "not yet sorry"

I'll post here as soon as I hear anything positive

Richard





Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

PeteL - MSFT

Could you share the KB number, or any other info that you may have. There are a few other people asking about this, and I'd like to see if we can expidite this.




Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

Johnny Kauffman

Three weeks ago, the person working on the IE7 modal dialog issue gave me an email, and it seemed that things were close to getting done:

Once we have verified that this new dll works correctly then we will move onto a final QA stage, final build, and then I will be able to get the final hotfix to you and ready to distribute to your customers.

The fix worked for our problem. However, we noticed that you can still give the parent window focus and access the "View" menu using the "Alt" key, then get to "Refresh" a couple times and crash the browser. I told them I didn't really care about this, but he seemed interested in fixing it. A couple days ago I emailed him back asking how things were going, and got a reply:

I am working on this with our VB6 developers as I am typing this email. The issue is difficult to track down since it spans parts of the OS, IE, and VB, but we are actively working on it. And now that everyone is back from vacation I am hoping to have some updates very soon. I will let you know as soon as I have more information, but please feel free to call or email me if you need anything.

They probably just stopped working on it for the winter holidays. I doubt I actually slowed the progress of the hotfix, but I'd sure find it funny if I did. I probably won't tell them about the other problems I've found, just to be safe!






Re: Internet Explorer Web Development ActiveX Modal Dialogs do work in IE7

Johnny Kauffman

stefanluchian,

You might try the single threaded option we found. If you don't have many timers or instances of your activex controls, it will probably work for you until the hotfix comes out.

Also, don't forget to use .Show (vbModal, ) instead of .Show(vbModal, Me). The microsoft contact specifically confirmed that this code change would be required for the fix to fully work.