You may receive a "System.TypeLoadException" error message when you use forward reference in Visual C++ .NET 2002 or in Visual C++ .NET 2003 (871182)
The information in this article applies to:
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ .NET (2002)
SYMPTOMSWhen you use a forward reference to a user-defined type that does not have the body defined in your code, you may receive the following error message. An unhandled exception of type 'System.TypeLoadException' occurred in Unknown Module. This problem occurs when the body is referenced instead of defined. You compile the code by using the common language runtime compilation compiler option (/clr). RESOLUTIONTo resolve this problem, you must define the body for the user-defined type. To define the body for the user-defined type, follow these steps: - Locate the following code in the MyProject.cpp file:
typedef struct _t_Struct *myStruct; - Add the following code after the code that you located in step 1:
struct _t_Struct
{
};
REFERENCESFor additional information, visit the following Microsoft Developer Network (MSDN) Web sites: TypeLoadException class /clr (common language runtime compilation)
Modification Type: | Minor | Last Reviewed: | 1/6/2006 |
---|
Keywords: | kberrmsg kbcode kbtshoot kbprb KB871182 kbAudDeveloper |
---|
|