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



The information in this article applies to:

  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Learning Edition for Windows 6.0

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.

REFERENCES

For additional information about implementing in-place enablement, visit the following Microsoft Developer Network (MSDN) Web site: For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

137516 How to register an MFC OLE Automation Server to avoid failure

129801 How to create and use a minimal OLE Automation Server


Modification Type:MajorLast Reviewed:10/27/2004
Keywords:kbServer kbactivation kbtshoot kbprb KB886837 kbAudDeveloper