PRB: Context Sensitive Help Problems in OLE Common Dialogs

Last reviewed: June 16, 1997
Article ID: Q167848
The information in this article applies to:
  • The Microsoft Foundation Classes (MFC) included with: - Microsoft Visual C++, 32-bit Editions, versions 4.2, 4.2b, 5.0

SYMPTOMS

When you invoke context-sensitive Help for some OLE common dialogs using the "?" button on the title bar or the F1 key, a window with the Help text appears along with the following error message:

   "The topic does not exist. Contact your application vendor for an
   updated Help file. (129)"

This only happens with MFC 4.2 and later versions.

CAUSE

This is due to a bug in the OLE common dialog implementation. After handling the WM_HELP message and displaying the window with the Help text, the OLE common dialog forwards the message to the parent of the common dialog. Because this Help ID does not exist in the .hlp file for the project, an error message is displayed saying that the Help topic does not exist.

RESOLUTION

Because the WM_HELP message is propagated to the parent, the workaround involves handling the message in the parent and preventing the error message from appearing. The following code does this:

   //main frame is the parent of the OLE common dialog
   BOOL CMainFrame::OnHelpInfo(HELPINFO* pHelpInfo)
   {
      //if there is pop-up window (dialog) and it is derived from
      //COleDialog (base class for OLE common dialogs) just return.
      CWnd *pWnd = FromHandle(::GetLastActivePopup(m_hWnd));

      if (pWnd->IsKindOf(RUNTIME_CLASS( COleDialog )))
         return TRUE;

      return CMDIFrameWnd::OnHelpInfo(pHelpInfo);
   }

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

To reproduce this problem, build and run the OCLIENT sample that shipped with Visual C++ 4.2 or later. From the edit menu, select Insert Object. This brings up the COleInsertDialog. Now, using the "?" button or pressing the F1 key, bring up context-sensitive Help for any of the controls. You will notice that along with the Help text window, an error message also appears.


Additional query words: ole common dialog context sensitive help
Keywords : kbcode kberrmsg MfcOLE vcbuglist420 kbfasttip
Technology : kbole kbmfc
Version : 4.2 4.2b 5.0
Platform : NT WINDOWS
Issue type : kbprb


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: June 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.