OleUnlockServer

3.1

  #include <ole.h>    

  OLESTATUS OleUnlockServer(hServer)    
  LHSERVER hServer; /* handle of server to unlock */

The OleUnlockServer function unlocks a server that was locked by the OleLockServer function.

Parameters

hServer

Identifies the server to release from memory. This handle was retrieved by a call to the OleLockServer function.

Return Value

The return value is OLE_OK if the function is successful. Otherwise, it is an error value, which may be one of the following:

OLE_ERROR_HANDLE OLE_WAIT_FOR_RELEASE

Comments

When the OleLockServer function is called more than once for a given server, the server's lock count is incremented. Each call to OleUnlockServer decrements the lock count. The server remains locked until the lock count is zero.

If the OleUnlockServer function returns OLE_WAIT_FOR_RELEASE, the application should call the OleQueryReleaseStatus function to determine whether the unlocking process has finished. In the call to OleQueryReleaseStatus, the application can cast the server handle to a long pointer to an object linking and embedding (OLE) object (LPOLEOBJECT):

    OleQueryReleaseStatus((LPOLEOBJECT) lhserver);

When OleQueryReleaseStatus no longer returns OLE_BUSY, the server has been unlocked.

See Also

OleLockServer, OleQueryReleaseStatus