Locks an already running object into its running state or unlocks it from its running state.
WINOLEAPI OleLockRunning(
LPUNKNOWN pUnknown, //Pointer to interface
BOOL fLock, //Flag indicating whether object is locked
BOOL fLastUnlockCloses
//Flag indicating whether to close object
);
This function supports the standard return values E_INVALIDARG, E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:
The OleLockRunning function saves you the trouble of calling the IRunnableObject::LockRunning method. You can use OleLockRunning and IRunnableObject::LockRunning interchangeably. With the IUnknown pointer passed in with the pUnknown parameter, OleLockRunning queries for an IRunnableObject pointer. If successful, it calls IRunnableObject::LockRunning and returns the results of the call.
Note The implementation of OleLockRunning in earlier versions of OLE differs from that described here.
For more information on using this function, see IRunnableObject::LockRunning.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in ole2.h.
Import Library: Included as a resource in ole32.dll.
CoLockObjectExternal, IRunnableObject::LockRunning, OleNoteObjectVisible