Microsoft KB Archive/236151

= BUG: MSMQQueue.Receive Fails with MQ_ERROR_INVALID_PARAMETER (0xC00E0006) =

Article ID: 236151

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft Message Queue Server 1.0

-



This article was previously published under Q236151



SYMPTOMS
With Microsoft Message Queue Server (MSMQ), there is an intermittent failure of MSMQQueue.Receive where eventually Receive fails with MQ_ERROR_INVALID_PARAMETER (0xC00E0006). The error message would look like the following:

An invalid parameter passed to a function.



CAUSE
Microsoft Message Queue Server prematurely unloads Mtxdm.dll.



RESOLUTION
Explicitly call the LoadLibrary API function for Mtxdm.dll when your program begins execution. Keep a reference to this library in your code and free this reference with FreeLibrary API function when your program ends. This will keep the DLL loaded in memory. To do this, complete the following steps:

  Using Microsoft Visual C++:

Add the following code to your function: HMODULE hModuleMTXDM;

// Program execution begins hModuleMTXDM = LoadLibrary(_T("mtxdm.dll")); .  .   . // Program execution ends FreeLibrary(hModuleMTXDM);  Using Microsoft Visual Basic:

  Add the following API declarations to a module in your project: Public Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long Public Declare Function FreeLibrary Lib "kernel32" Alias "FreeLibrary" (ByVal hLibModule As Long) As Long   Add a variable to hold the handle of the library to your project: Dim hModuleMTXDM as Long   When your program begins execution, explicitly load the library: hModuleMTXDM = LoadLibary("mtxdm.dll")   When your program is ending, free the reference to the library: FreeLibrary(hModuleMTXDM) </li></ol> </li></ul>

Also, you can keep the reference to the DLL and just exit from your application. This will unload any libraries that were loaded in your process space.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

Keywords: kbbug kbpending KB236151

-

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

© Microsoft Corporation. All rights reserved.