You are currently offline, waiting for your internet to reconnect

Your browser is out-of-date

You need to update your browser to use the site.

Update to the latest version of Internet Explorer

BUG: RPC_E_CANTCALLOUT_ININPUTSYNCCALL Error When System Menu Is Shown in Taskbar

This article was previously published under Q198996
SYMPTOMS
When an application tries to call a Component Object Model (COM) method while the user has displayed the system menu from the application's taskbar button, the COM call fails with RPC_E_CANTCALLOUT_ININPUTSYNCCALL.

The following list outlines in detail what occurs:
  1. A thread creates a window that has a corresponding taskbar button.
  2. The thread makes outgoing COM calls in response to posted window messages, such as WM_TIMER messages.
  3. The user right-clicks the taskbar button or sets the keyboard focus on the button. Then the user presses the SHIFT+F10 key combination or the Application key.
  4. The shell sends a message to the thread using the SendNotifyMessage function. The default message handler displays the system menu and runs a message loop to service the menu.
  5. The thread receives and processes a posted message that causes it to attempt an outgoing COM call.
  6. The COM call fails with RPC_E_CANTCALLOUT_ININPUTSYNCCALL.
CAUSE
COM does not allow normal outgoing COM method calls from a thread that is currently servicing a SendMessage request. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
131056 PRB: Synch OLE Call Fails in Inter-Process/Thread SendMessage
When the system menu is displayed in the taskbar, the thread that owns the window is servicing a SendNotifyMessage request. On Windows 95, Windows 98, and Windows NT 4.0, COM does not distinguish between SendMessage and SendNotifyMessage.
RESOLUTION
This bug was corrected in Microsoft Windows 2000. In Windows 2000, COM uses the InSendMessageEx function to detect a true SendMessage request.

To work around this problem if the application is running Windows 95, Windows 98, or Windows NT 4.0, use one of the following methods:
  • Allow outgoing COM calls to fail with RPC_E_CANTCALLOUT_ININPUTSYNCCALL.
  • Call InSendMessage before you make any outbound COM calls in response to posted window messages. If InSendMessage returns TRUE, do not attempt an outgoing COM call.
  • Make outgoing COM calls on another thread.
  • Prevent the taskbar from creating a button for the window. To do this, create the window with the WS_EX_TOOLWINDOW extended style, or create a hidden window, and make the hidden window the owner of the visible window.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Windows 2000.
Properties

Article ID: 198996 - Last Review: 12/01/2003 16:01:28 - Revision: 3.2

  • Microsoft COM+ 2.0 Standard Edition
  • kbbug kbfix KB198996
Feedback
&did=1&t=">microsoft.com/c.gif?DI=4050&did=1&t=">ng = 1; var Route = "76500"; var Ctrl = ""; document.write(" ')[0].appendChild(m);" onload="var m=document.createElement('meta');m.name='ms.dqp0';m.content='false';document.getElementsByTagName('head')[0].appendChild(m);" src="http://c1.microsoft.com/c.gif?"> >>