LresultFromObject

[This is preliminary documentation and subject to change.]

Generates a reference to an accessible object, in the form of an LRESULT value.

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

Parameters

riid
Reference identifier of the interface that USER will provide to the client.
wParam
Value as provided in the wParam parameter received with the associated WM_GETOBJECT message.
punk
Address of the IUnknown interface for the object whose reference is being generated.

Return Values

Returns a positive object reference if successful or one of the following error codes otherwise.

E_INVALIDARG One or more arguments are invalid.
E_NOINTERFACE The punk parameter does not support the interface riid parameter.
E_OUTOFMEMORY Insufficient memory to store the object reference.
E_UNEXPECTED An unexpected error occurred.

Remarks

This function can return other values, identical to those returned by the CoMarshalInterface OLE function.

Active Accessibility server applications use this function to retrieve a return value while processing the WM_GETOBJECT message. This function is called only by Active Accessibility server applications, not clients.

The riid parameter identifies the interface that will be provided and allows oleacc.dll to optimize marshaling between the client and the server. That is, if a given interface has already been provided for an object, oleacc.dll will optimize the process by using the existing interface rather than creating another one in shared memory.

A value returned from LresultFromObject can be passed to ObjectFromLresult only once; if it is passed subsequent times the error result will be returned from this function.

Since this function creates a weak reference (MSHLFLAGS_TABLEWEAK) to an object, the object's table is not affected.