The information in this article applies to:
SYMPTOMS
When automating an out-of-process COM server from a client application, if the client code enters a tight loop or makes extensive requests for obtaining new interfaces, the client application might hang during an automation call, requiring the user to terminate the process abnormally. Once hung, any COM request involving a marshaled interface fails. A reboot is required to clear the problem. CAUSE
When an interface is marshaled across process boundaries, a number of system objects are created to handle communication between the client and server processes. This includes the proxy/stub, along with the OID and OXID needed by COM to identify the interface being marshaled. When the interface is released by the client process, these objects will be destroyed during garbage collection.
For Windows 95 and Windows 98, the total number of interfaces that can be marshaled at once is approximately 65,536.
RESOLUTION
Developers need to minimize the number of object references they request during tight loops or heavy periods of automation. If an interface is needed more than once, it should be held on to and used repeatedly rather than released and reacquired several times in succession.
Another possible solution might be to move some of the automation code in-process to the server, if the server allows for in-process scripting. For example, Microsoft Office products incorporate VBA scripting for internal automation. By moving the loop code into a VBA module, you could avoid marshaling multiple interfaces, and instead invoke a macro that lets the server do all the work.
REFERENCESFor additional information, please see the following article in the Microsoft Knowledge Base: Q219905 HOWTO: Dynamically Add and Run a VBA Macro from Visual Basic Additional query words:
Keywords : kbole kbActiveX kbAutomation kbCOMt kbOLEApp kbWinOS95 kbWinOS98 kbGrpDSO |
Last Reviewed: June 18, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |