Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

You may receive a "System.Runtime.InteropServices.COMException" exception error when you try to send a large message by using the Large Message to MSMQT sample application in BizTalk Server 2004


View products that this article applies to.

Symptoms

In Microsoft BizTalk Server 2004, when you try to send a large message by using the Large Message to MSMQT sample application, you may intermittently receive the following exception error message:
System.Runtime.InteropServices.COMException (0xC00E0007): Exception from HRESULT: 0xC00E0007. at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo) at LargeMessages.LargeMessageQueue.Send(LargeMessage message)
Typically this problem occurs when the server is under a heavy load.

Note The sample application uses the MQSendLargeMessage API implemented by the BizTalk Message Queuing Large Message Extension (Mqrtlarge.dll).

↑ Back to the top


Cause

This problem occurs because the queue is closed and then the queue is accessed again. Therefore, the second access throws the invalid handle error.

↑ Back to the top


Resolution

To resolve this problem, you must make two changes in the Queue.h header file. To do this, follow these steps:
  1. Start Microsoft Visual Studio .NET.
  2. Open the LargeMessages.sln solution.
  3. In Solution Explorer, right-click Queue.h, and then click Open.
  4. Locate the following code on line 48:
    MQCloseQueue(queueHandle);
    Change this source code to the following code:
    MQCloseQueue(queueHandle);
    
    queueHandle=NULL;
  5. Locate the following code on line 195:
    MQCloseQueue(unmanagedQueueData->queueHandle);
    Change this source code to the following code:
    MQCloseQueueunmanagedQueueData->queueHandle);
    
    unmanagedQueueData->queueHandle=NULL;
    
  6. On the Build menu, click Build Solution to rebuild the solution.

↑ Back to the top


More information

For more information about the BizTalk Message Queuing Large Message Extension, visit the following Microsoft Developer Network (MSDN) Web site:For more information about the Large Message to MSMQT sample application, visit the following MSDN Web site:

↑ Back to the top


Keywords: KB897294, kbprb, kbtshoot, kbbtsmessaging

↑ Back to the top

Article Info
Article ID : 897294
Revision : 3
Created on : 3/15/2007
Published on : 3/15/2007
Exists online : False
Views : 381