Microsoft KB Archive/897294

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

Article ID: 897294

Article Last Modified on 3/15/2007

-

APPLIES TO


 * Microsoft BizTalk Server 2004 Enterprise Edition
 * Microsoft BizTalk Server 2004 Standard Edition
 * Microsoft BizTalk Server 2004 Partner Edition
 * Microsoft BizTalk Server 2004 Developer Edition

-





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).



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.



RESOLUTION
To resolve this problem, you must make two changes in the Queue.h header file. To do this, follow these steps:  Start Microsoft Visual Studio .NET. Open the LargeMessages.sln solution. In Solution Explorer, right-click Queue.h, and then click Open.  Locate the following code on line 48: MQCloseQueue(queueHandle); Change this source code to the following code: MQCloseQueue(queueHandle);

queueHandle=NULL;   Locate the following code on line 195: MQCloseQueue(unmanagedQueueData->queueHandle); Change this source code to the following code: MQCloseQueueunmanagedQueueData->queueHandle);

unmanagedQueueData->queueHandle=NULL;  On the Build menu, click Build Solution to rebuild the solution.</li></ol>

<div class="moreinformation_section">

MORE INFORMATION
For more information about the BizTalk Message Queuing Large Message Extension, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/ms966486.aspx

For more information about the Large Message to MSMQT sample application, visit the following MSDN Web site:

http://msdn2.microsoft.com/en-us/library/ms966060.aspx

Additional query words: BTS2004

Keywords: kbbtsmessaging kbtshoot kbprb KB897294

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.