The information in this article applies to:
SYMPTOMSYou are performing intensive OLE Automation, most likely in a loop without user intervention, and receive the following error:
CAUSEEvery thread that uses COM or OLE must call CoInitialize() or OleInitialize(), respectively. When this call is made, the OS creates a hidden top-level window, owned by your thread, for implementation purposes. Because the OS relies on Windows messaging behind-the-scenes, your thread should, and in some cases MUST, pump messages. Failure to do so can result in automation errors, and sometimes in a deadlock situation when another application broadcasts a message to all top-level windows (for example, an application might broadcast a WM_WININICHANGE or WM_SETTINGCHANGE message to notify other applications the default printer has changed). RESOLUTIONIf you are using OLE Automation in a loop (for example, writing out 10,000 rows of data to Microsoft Excel), you need a PeekMessage() loop inside your loop so that messages will get processed. STATUSThis behavior is by design. MORE INFORMATIONHere is an example of a PeekMessage() loop you can use in your code.
REFERENCES
Microsoft Visual C++ online for PeekMessage().
© Microsoft Corporation 1998, All Rights Reserved. Additional query words: excel office rpc -2147418095 800706BE 0x800706BE 1726
Keywords : kbcode kberrmsg kbole kbAutomation kbMFC kbVC400 kbVC500 kbVC600 |
Last Reviewed: July 28, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |