IRunnableObject::LockRunning method

Locks an already running object into its running state or unlocks it from its running state.

Syntax


HRESULT LockRunning(
  [in] BOOL fLock,
  [in] BOOL fLastUnlockCloses
);

Parameters

fLock [in]

TRUE locks the object into its running state. FALSE unlocks the object from its running state.

fLastUnlockCloses [in]

TRUE specifies that if the connection being released is the last external lock on the object, the object should close. FALSE specifies that the object should remain open until closed by the user or another process.

Return value

This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, E_FAIL, and S_OK.

Remarks

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.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

ObjIdl.h

IDL

ObjIdl.idl

IID

IID_IRunnableObject is defined as 00000126-0000-0000-C000-000000000046

See also

CoLockObjectExternal
IRunnableObject
OleLockRunning

 

 

Show: