Export (0) Print
Expand All

OleLockRunning function

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

Syntax


HRESULT OleLockRunning(
  _In_  LPUNKNOWN pUnknown,
  _In_  BOOL fLock,
  _In_  BOOL fLastUnlockCloses
);

Parameters

pUnknown [in]

Pointer to the IUnknown interface on the object, which the function uses to query for a pointer to IRunnableObject.

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 function returns S_OK on success. Other possible values include the following.

Return codeDescription
E_OUTOFMEMORY

Insufficient memory for the operation.

E_INVALIDARG

One or more parameters are invalid.

E_UNEXPECTED

An unexpected error occurred.

 

Remarks

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.

For more information on using this function, see IRunnableObject::LockRunning.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Ole2.h

Library

Ole32.lib

DLL

Ole32.dll

See also

CoLockObjectExternal
IRunnableObject::LockRunning
OleNoteObjectVisible

 

 

Community Additions

ADD
Show:
© 2014 Microsoft