Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

OleNoteObjectVisible function

Increments or decrements an external reference that keeps an object in the running state.

Syntax


HRESULT OleNoteObjectVisible(
  _In_  LPUNKNOWN pUnknown,
  _In_  BOOL fVisible
);

Parameters

pUnknown [in]

Pointer to the IUnknown interface on the object that is to be locked or unlocked.

fVisible [in]

Whether the object is visible. If TRUE, OLE increments the reference count to hold the object visible and alive regardless of external or internal IUnknown::AddRef and IUnknown::Release operations, registrations, or revocation. If FALSE, OLE releases its hold (decrements the reference count) and the object can be closed.

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 OleNoteObjectVisible function calls the CoLockObjectExternal function. It is provided as a separate function to reinforce the need to lock an object when it becomes visible to the user and to release the object when it becomes invisible. This creates a strong lock on behalf of the user to ensure that the object cannot be closed by its container while it is visible.

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

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.