Article ID: 257664 - Last Review: October 9, 2003 - Revision: 2.0

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

This article was previously published under Q257664
Expand all | Collapse all

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  (http://support.microsoft.com/kb/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  (http://support.microsoft.com/kb/194022/EN-US/ ) INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295  (http://support.microsoft.com/kb/194295/EN-US/ ) HOWTO: Tell That a Visual Studio Service Pack Is Installed
To download the latest Visual Studio service pack, visit the following Microsoft Web site:
http://msdn.microsoft.com/vstudio/previous/vs6/downloads/default.aspx (http://msdn.microsoft.com/vstudio/previous/vs6/downloads/default.aspx)

APPLIES TO
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 6.0 Enterprise Edition
Keywords: 
kbbug kbfix kbthread kbvs600sp4fix kbvs600sp5fix KB257664
 

Article Translations