FIX: MFC Active Document Container Can Hang After Invoking Server's About Box (224788)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q224788 SYMPTOMS
Invoking the About box of a DocObject, from an MFC DocObject container, can cause a deadlock that will cause both container and server to lock up.
DocObject containers display a merged Help menu that contains About box menu items for both the DocObject container and the current in-place active DocObject server. When a user attempts to invoke the About box of the DocObject server from this merged Help menu, the server's About box will be displayed as expected. But if the user moves input focus to another window, and then attempts to dismiss the server's About box, the About box will become disabled, and both the container and server will be hung.
CAUSE
This deadlock condition is a result of the MFC DocObject container forwarding the WM_COMMAND message for the server's About box via the SendMessage API. The MFC DocObject container is the first to receive the WM_COMMAND message to invoke the About box. When the container receives the message, it needs to forward the message to the server, so the server can invoke its About box.
This is done in an undocumented function called COleFrameHook::OnPreTranslateMessage. COleFrameHook::OnPreTranslateMessage is called by the container's main frame window when the container is currently hosting an in-place active embedding or DocObject.
Because SendMessage is synchronous, the MFC DocObject container stops pumping messages and waits for the server to completely process the WM_COMMAND message, which is what introduces the deadlock condition.
STATUS
This bug was corrected in Microsoft Visual C++ .NET 2002.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 1/6/2004 |
---|
Keywords: | kbfix kbActiveDocs kbBug kbContainer kbLocalSvr kbpending KB224788 kbAudDeveloper |
---|
|