FIX: Object in a DLL on a Non-UI Thread Disables Modeless Forms in UI Thread (257664)



The information in this article applies to:

  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0

This article was previously published under Q257664

SYMPTOMS

When an executable creates a new thread, and that thread creates an object in a Visual Basic ActiveX DLL, the application can no longer show a non-modal form. This is true regardless of the language of the executable, as long as the executable implements the interface that is described by the following article.

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

247791 PRB: Modeless Forms in VB ActiveX DLL's Don't Display in VC++ Clients

CAUSE

The problem occurs due to a flag underlying the App.NonModalAllowed object that is set to be global instead of per-thread. It is set for the entire process to the value of the last loaded thread. Because the new thread has no message filter and no component manager, the flag is cleared and it removes the EXE's modeless capabilities.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the latest service pack for Visual Studio 6.0.

For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed

To download the latest Visual Studio service pack, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:10/9/2003
Keywords:kbBug kbfix kbThread kbVS600sp4fix kbVS600sp5fix KB257664 kbAudDeveloper