Gets a message from the message queue.
public:
HRESULT GetMessage(
DXGI_DEBUG_ID Producer,
UINT64 MessageIndex,
*pMessage,
SIZE_T *pMessageByteLength
)
Producer
Type: DXGI_DEBUG_ID
[in] A DXGI_DEBUG_ID value that identifies the entity that gets the message.
MessageIndex
Type: UINT64
[in] An index into the message queue after an optional retrieval filter has been applied. This can be between 0 and the number of messages in the message queue that pass through the retrieval filter. Call IDXGIInfoQueue::GetNumStoredMessagesAllowedByRetrievalFilters to obtain this number. 0 is the message at the beginning of the message queue.
pMessage
Type: *
A pointer to a DXGI_INFO_QUEUE_MESSAGE structure that describes the message.
pMessageByteLength
Type: SIZE_T *
[in, out] A pointer to a variable that receives the size, in bytes, of the message description that pMessage points to. This size includes the size of the message string that pMessage points to.
Type: HRESULT
Returns S_OK if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.
This method doesn’t remove any messages from the message queue.
This method gets a message from the message queue after an optional retrieval filter has been applied.
Call this method twice to retrieve a message, first to obtain the size of the message and second to get the message. Here is a typical example:
// Get the size of the message.
SIZE_T messageLength = 0;
HRESULT hr = pInfoQueue->GetMessage(DXGI_DEBUG_ALL, 0, NULL, &messageLength);
// Allocate space and get the message.
DXGI_INFO_QUEUE_MESSAGE * pMessage = (DXGI_INFO_QUEUE_MESSAGE*)malloc(messageLength);
hr = pInfoQueue->GetMessage(DXGI_DEBUG_ALL, 0, pMessage, &messageLength);
Header: Declared in dxgidebug.h.
Library: Use d3d11.lib.