Updated: July 19, 2016

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

The MQGetOverlappedResult function retrieves the Message Queuing success or error code from the OVERLAPPED structure used to retrieve a message asynchronously.

HRESULT APIENTRY MQGetOverlappedResult(  
  LPOVERLAPPED lpOverlapped  


[in] The OVERLAPPED structure used to retrieve the message.


Indicates success.


There are not enough resources to complete operation (for example, not enough memory). Operation failed.


No message was received within the time-out period specified by dwTimeout in the preceding call to MQReceiveMessage.

Call this function after the event is signaled or after you get a completion port notification. The function retrieves the success or error code from the Internal member of the OVERLAPPED structure.

The following code example is included in Using Message Queuing.

For an example ofSee
Retrieving the Message Queuing success or error code from an OVERLAPPED structure after receiving a completion port notificationC/C++ Code Example: Reading Messages Asynchronously Using Completion Ports

Windows NT/2000/XP: Included in Windows 2000 and later.

Windows 95/98/Me: Unsupported.

Header: Declared in Mq.h.

Library: Use Mqrt.lib.

Message Queuing Functions

Community Additions