|
IRunnableObject::LockRunning
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
| );
|
|
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 Values
S_OK
If the value of fLock is TRUE, the object was successfully locked; if the value of fLock is FALSE, the object was successfully unlocked.
E_FAIL
The object was not running.
E_OUTOFMEMORY
Out of memory.
E_INVALIDARG
One or more arguments are invalid.
E_UNEXPECTED
An unexpected error occurred.
Comments
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.
See Also
CoLockObjectExternal
Related LinksSoftware for Delphi and C++ Builder developers Software for Visual Studio .NET developers Software for Visual Basic 6 developers Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps Win32 Programmer's Reference (win32.hlp) Win32 Multimedia Programmer's Reference (mmedia.hlp) Microsoft Windows Pen API Programmer's Reference (penapi.hlp) Microsoft Windows Sockets 2 Reference (sock2.hlp) Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp) Unix Manual Pages
|