Microsoft KB Archive/257664

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

Article ID: 257664

Article Last Modified on 10/9/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



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:

http://msdn.microsoft.com/vstudio/previous/vs6/downloads/default.aspx

Additional query words: sp4

Keywords: kbbug kbfix kbthread kbvs600sp4fix kbvs600sp5fix KB257664

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.