LresultFromObject function (oleacc.h)

Returns a reference, similar to a handle, to the specified object. Servers return this reference when handling WM_GETOBJECT.

Syntax

LRESULT LresultFromObject(
  [in] REFIID    riid,
  [in] WPARAM    wParam,
  [in] LPUNKNOWN punk
);

Parameters

[in] riid

Type: REFIID

Reference identifier of the interface provided to the client. This parameter is IID_IAccessible.

[in] wParam

Type: WPARAM

Value sent by the associated WM_GETOBJECT message in its wParam parameter.

[in] punk

Type: LPUNKNOWN

Address of the IAccessible interface to the object that corresponds to the WM_GETOBJECT message.

Return value

Type: LRESULT

If successful, returns a positive value that is a reference to the object.

If not successful, returns one of the values in the table that follows, or another standard COM error code.

Return code Description
E_INVALIDARG
One or more arguments are not valid.
E_NOINTERFACE
The object specified in the pAcc parameter does not support the interface specified in the riid parameter.
E_OUTOFMEMORY
Insufficient memory to store the object reference.
E_UNEXPECTED
An unexpected error occurred.

Remarks

Servers call this function only when handling the WM_GETOBJECT message. For an overview of how LresultFromObject is related to WM_GETOBJECT, see How WM_GETOBJECT Works.

LresultFromObject increments the object's reference count. If you are not storing the interface pointer passed to the function (that is, you create a new interface pointer for the object each time WM_GETOBJECT is received), call the object's Release method to decrement the reference count back to one. Then the client calls Release and the object is destroyed. For more information, see How to Handle WM_GETOBJECT.

Each time a server processes WM_GETOBJECT for a specific object, it calls LresultFromObject to obtain a new reference to the object. Servers do not save the reference returned from LresultFromObject from one instance of processing WM_GETOBJECT to use as the message's return value when processing subsequent WM_GETOBJECT messages for the same object. This causes the client to receive an error.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header oleacc.h
Library Oleacc.lib
DLL Oleacc.dll
Redistributable Active Accessibility 1.3 RDK on Windows NT 4.0 with SP6 and later and Windows 95

See also

Creating Proxy Objects

How WM_GETOBJECT Works

How to Handle WM_GETOBJECT

WM_GETOBJECT