Microsoft KB Archive/886837

= The in-place enabled object from the Automation Server cannot retain the keyboard focus when a window is reactivated =

Article ID: 886837

Article Last Modified on 1/17/2007

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Learning Edition

-





SYMPTOMS
The Automation Server object that supports in-place enablement loses the focus when another application is enabled. This problem occurs in a Microsoft Visual Basic 6.0 application. When the focus is returned from another application, the in-place enabled object cannot regain the focus.

Notes
 * The Automation Server was developed by using Microsoft Visual C++ .NET without the MFC library or the ATL library.
 * Make sure that your computer is running Microsoft Windows XP Professional Service Pack 1.



WORKAROUND
To work around this problem, use one of the following methods:

Method 1

Create the Automation Server by using the MFC library or the ATL library.

Method 2

After application focus is regained, you can implement a method to call the FindWindow function APIs and the SetFocus function APIs.



STATUS
This behavior is by design.

