Locks an already running object into its running state or unlocks it from its running state.
HRESULT LockRunning(
BOOL fLock, //Flag indicating whether object is locked
BOOL fLastUnlockCloses
//Flag indicating whether to close object
);
This method supports the standard return values E_FAIL, E_INVALIDARG, E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:
Most implementations of IRunnableObject::LockRunning call CoLockObjectExternal.
OleLockRunning is a helper function that conveniently repackages the functionality offered by IRunnableObject::LockRunning. With the release of OLE 2.01, the implementation of OleLockRunning was changed to call QueryInterface, ask for IRunnableObject, and then call IRunnableObject::LockRunning. In other words, you can use the interface and the helper function interchangeably.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in objidl.h.