FIX: Invisible at Run Time ActiveX Control, Visible at Run Time
Article ID: 189585
Article Last Modified on 11/21/2006
APPLIES TO
- Microsoft Foundation Class Library 4.2, when used with:
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
This article was previously published under Q189585
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.
This problem was corrected in Microsoft Visual C++ .NET.
Additional query words: ocx design time MSComm CommDlg
Keywords: kbbug kbcontainer kbctrl kbfix kbnoupdate KB189585