LresultFromObject function

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 pAcc
);

Parameters

riid [in]

Type: REFIID

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

wParam [in]

Type: WPARAM

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

pAcc [in]

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 codeDescription
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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Redistributable

Active Accessibility 1.3 RDK on Windows NT 4.0 with SP6 and later and Windows 95

Header

Oleacc.h

Library

Oleacc.lib

DLL

Oleacc.dll

See also

Creating Proxy Objects
How to Handle WM_GETOBJECT
How WM_GETOBJECT Works
WM_GETOBJECT

 

 

Community Additions

ADD
Show:
© 2014 Microsoft