Microsoft KB Archive/116180

{|
 * width="100%"|

BUG: Escape Key Deactivation of In-Place Item in OLE Server

 * }

Q116180

1.50 1.51 1.52 WINDOWS kbprg kbbuglist -- The information in this article applies to: - The Microsoft Foundation Classes (MFC) included with: Microsoft Visual C++ for Windows, versions 1.5, 1.51, and 1.52 -- SYMPTOMS ======== Unless an Object Linking and Embedding (OLE) Visual Editing container processes the ESC key itself to deactivate the active item, the only way to deactivate an item embedded from Visual Editing server (created with AppWizard) is to click with the mouse outside of the server window that is in place. CAUSE ===== By default, OLE Visual Editing servers created with AppWizard do not provide this functionality. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATION ================ The following information is from the README.WRI file provided with Visual C++ for Windows, version 1.5: The OLE 2.0 specification states that both servers and containers should process the ESC key to end in-place activation. Any OLE Visual Editing container application created with AppWizard will automatically provide an accelerator key and a handler to do this. OLE Visual Editing servers created with AppWizard, however, will not provide this functionality automatically. If either the container or the server does not process the ESC key to deactivate the active item, the only way the application user can deactivate such a server is to click with the mouse outside of the in-place server window. Because AppWizard does not automatically implement the ESC key handler in the server application, you should implement one by doing the following: 1) Add an accelerator for VK_ESCAPE to your in-place server's accelerator table. This accelerator table should have the same ID as your server's in-place menu resource. The default ID generated from AppWizard is IDR_<>TYPE_SRVR_IP. 2) Using ClassWizard, add a handler for the VK_ESCAPE accelerator. In a typical application, you will want to implement the handler in the COleServerDoc-derived class. The handler should attempt to deactivate the in-place item only if the document is in-place active. For example: void CMyServerDoc::OnCancelInplace { if (IsInPlaceActive) OnDeactivateUI; } This problem does not occur with Visual C++ 32-bit Edition. AppWizard generates the accelerator and the code to handle this situation. Additional reference words: 1.50 2.5 2.50 2.51 2.52 KBCategory: kbprg kbbuglist KBSubcategory: MfcOLE

Keywords : kb16bitonly

Issue type :

Technology : kbAudDeveloper kbMFC