IMessageFilter::HandleInComingCall Method

Provides a single entry point for incoming calls.

This method is called prior to each method invocation originating outside the current process and provides the ability to filter or reject incoming calls (or callbacks) to an object or a process.

Syntax

C++
DWORD HandleInComingCall(
  [in]  DWORD dwCallType,
  [in]  HTASK htaskCaller,
  [in]  DWORD dwTickCount,
  [in]  LPINTERFACEINFO lpInterfaceInfo
);

Parameters

dwCallType [in]

The type of incoming call that has been received. Possible values are from the enumeration CALLTYPE.

htaskCaller [in]

The handle of the calling task.

dwTickCount [in]

The elapsed tick count since the outgoing call was made, if dwCallType is not CALLTYPE_TOPLEVEL. If dwCallType is CALLTYPE_TOPLEVEL, dwTickCount should be ignored.

lpInterfaceInfo [in]

A pointer to an INTERFACEINFO structure that identifies the object, interface, and method making the call. In the case of DDE calls, lpInterfaceInfo can be NULL because the DDE layer does not return interface information.

Return Value

This method can return the following values.

Return codeDescription
SERVERCALL_ISHANDLED

The application might be able to process the call.

SERVERCALL_REJECTED

The application cannot handle the call due to an unforeseen problem, such as network unavailability, or if it is in the process of terminating.

SERVERCALL_RETRYLATER

The application cannot handle the call at this time. An application might return this value when it is in a user-controlled modal state.

 

Remarks

If implemented, HandleInComingCall is called by COM when an incoming COM message is received.

Depending on an application's current state, a call is either accepted and processed or rejected (permanently or temporarily). If SERVERCALL_ISHANDLED is returned, the application may be able to process the call, although success depends on the interface for which the call is destined. If the call cannot be processed, COM returns RPC_E_CALL_REJECTED.

Input-synchronized and asynchronous calls are dispatched even if the application returns SERVERCALL_REJECTED or SERVERCALL_RETRYLATER.

HandleInComingCall should not be used to hold off updates to objects during operations such as band printing. For that purpose, use IViewObject::Freeze.

You can also use HandleInComingCall to set up the application's state so that the call can be processed in the future.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderObjIdl.h
IDLObjIdl.idl
IIDIID_IMessageFilter is defined as 00000016-0000-0000-C000-000000000046

See Also

IMessageFilter

Send comments about this topic to Microsoft

Build date: 11/12/2009

Tags :


Page view tracker