BUG: Invisible at Run Time ActiveX Control, Visible at Run Time

ID: Q189585


The information in this article applies to:


SYMPTOMS

An invisible run-time ActiveX control is visible at run time if it is the only control on a dialog box.


CAUSE

This problem occurs because there is no other control the focus can be set to, so AppWizard-generated MFC code sets focus to the only control there (that is, returns TRUE in the OnInitDialog() function of your CDialog- derived class), and therefore activates it.


RESOLUTION

Change the return value of the OnInitDialog() function in your derived CDialog class from TRUE to FALSE.


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

Steps to Reproduce Behavior

  1. Create an MFC dialog box-based application using AppWizard.


  2. Remove all controls from the AppWizard-generated dialog box.


  3. Insert an ActiveX control that is invisible at run time (for example, Microsoft Communications Control or Microsoft Common Dialog Control).


  4. Build and run the application.


RESULTS: You should see that the ActiveX control's design-time representation is visible on the dialog box at run time.

(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Yeong- Kah Tam, Microsoft Corporation

Additional query words: kbDSupport ocx kbvc500bug kbVC600bug kbMFC kbOLE


Keywords          : kbVC600bug 
Version           : WINNT:5.0,6.0
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: August 5, 1999