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

Last reviewed: July 22, 1997
Article ID: 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_<<PROJNAME>>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
Technology : kbMfc


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.