OLE Methods and Callbacks Must Not Call OLE Functions

Last reviewed: February 17, 1995
Article ID: Q83018
The information in this article applies to:
  • Microsoft OLE version 1.0

SUMMARY

In an application developed using the object linking and embedding (OLE) libraries, any callback function (also known as a method) must not call any OLE library function. An application can call an OLE function only outside the context of the callback functions, which include all functions referred to in the OLECLIENTVTBL, OLESTREAMVTBL, OLEOBJECTVTBL, OLESERVERVTBL, and OLESERVERDOCVTBL structures defined in the OLE.H header file.

Windows calls a callback function while the OLE libraries are performing an asynchronous operation. Any object affected during the operation is marked as busy; therefore, calling any OLE function that may affect that object is forbidden.

Most OLE functions return an error code when used from a callback function. The one exception to this rule is during processing of the OLESERVERDOC Close method. When this method is called, the server application must call OleRevokeServerDoc. If this call generates an OLE_WAIT_FOR_RELEASE return code, the server ignores the returned value. The OLE server library calls the Close method to close a document unconditionally.


Additional reference words: 1.00
KBCategory: kbole kbprg
KBSubcategory: LeOneCli LeOneSvr


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.