The Visual C++ compiler generates an incorrect Microsoft intermediate language (MSIL) data type for a managed pointer to an IntPtr variable (843415)
The information in this article applies to:
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ .NET (2002)
- Microsoft .NET Framework 1.1
- Microsoft .NET Framework 1.0
SYMPTOMSWhen you compile Microsoft Visual C++ .NET code that contains managed data
types, the Visual C++ .NET compiler (Cl.exe) generates an incorrect Microsoft
intermediate language (MSIL) data type for a managed pointer to an IntPtr
variable.
For example, if your Visual C++ .NET code contains a managed
pointer to an IntPtr variable, the Visual C++ .NET compiler generates native int as the MSIL data type for the IntPtr variable and [mscorlib]System.IntPtr& as the MSIL data type for the pointer variable. The expected MSIL
data type for the pointer variable is native int&.
Note When you run a program that uses MSIL code that contains an
incorrect MSIL data type, a System.TypeLoadException exception may occur. This
exception typically occurs when you run the Visual Studio Industry Partner (VSIP)
program software development kit (SDK) sample programs.RESOLUTION
To resolve this problem, obtain the latest service pack for Visual Studio .NET 2002. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
837234 List of bugs that are fixed in Visual Studio .NET 2002 Service Pack 1
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section. This bug was corrected in Microsoft
Visual Studio .NET 2002 Service Pack 1.
REFERENCESFor additional information, visit the following Microsoft
Developer Network (MSDN) Web sites:
Modification Type: | Minor | Last Reviewed: | 1/12/2006 |
---|
Keywords: | kbManaged kbtshoot kbCPPonly kbLangCPP kbSample kbCodeGen kbCompiler kbbug KB843415 kbAudDeveloper |
---|
|