Microsoft KB Archive/904708

= FIX: You may receive a &quot;The memory could not be 'read'&quot; error message, or a COM+ Interop type mismatch exception error occurs when you run .NET Framework applications that use the AS/400 Data Queue ActiveX control =

Article ID: 904708

Article Last Modified on 12/4/2007

-

APPLIES TO


 * Microsoft Host Integration Server 2004 Standard Edition

-





SYMPTOMS
When you run Microsoft .NET Framework applications that use the AS/400 Data Queue ActiveX control (Mseigdq.dll) to read from and to write to IBM iSeries (AS/400) data queues, you may experience one or more of the following problems:  You receive application error messages that are similar to the following:

– Application Error

The instruction at &quot;memory address&quot; referenced memory at &quot;0x00000000&quot;. The memory could not be &quot;read&quot;.

Click on OK to terminate the program

Click on CANCEL to debug the program

 A Microsoft COM+ Interop type mismatch exception occurs when you try to process a record that is returned when the application calls the DataQueue.GetQueueItem method. This exception only occurs when the application uses managed code. This exception does not occur if the application uses Microsoft Visual Basic 6. The error message that you receive may be similar to the following:

System.Runtype.InteropServices.SafeArrayTypeMismatchException





CAUSE
You receive a &quot;The memory could not be 'read'&quot; error message because the AS/400 Data Queue ActiveX control tries to read an invalid memory location.

The COM+ Interop type mismatch exception occurs because the AS/400 Data Queue ActiveX control returns record data as a safe array of VT_UI1 data. This data is not Automation compatible. This behavior causes the COM+ Interop layer to return the type mismatch exception because the COM Interop layer does not know how to marshal the VT_UI1 data.



RESOLUTION
A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.   Date         Time   Version     Size     File name 29-Sep-2005 19:39  6.0.1988.0  121,344  Mseigdq.dll Note Because of file dependencies, the most recent fix that contains these files may also contain additional files.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
This hotfix updates the AS/400 Data Queue ActiveX control to fix the problem that causes application error messages when invalid memory is accessed.

This hotfix does not fix the problem in which a COM+ Interop type mismatch exception occurs. However, you can resolve problem by using the .NET Framework 2.0 on any computer that is running a .NET Framework application that calls the AS/400 Data Queue ActiveX control. The .NET Framework 2.0 can correctly marshal unsigned byte arrays such as VT_UI1 data types. Therefore, the type mismatch exception does not occur.

Keywords: kbbug kbfix kbqfe kbpubtypekc kbhotfixserver kbhis2004 KB904708

-

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

© Microsoft Corporation. All rights reserved.