Article ID: 193477
Article Last Modified on 11/18/2003
APPLIES TO
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
This article was previously published under Q193477
SYMPTOMS
When creating a derived C++ class, Developer Studio exits with no warning or error message.
CAUSE
A global variable of that class was declared before the derived C++ class was defined.
RESOLUTION
Always define the class first before declaring global variables from that class.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
This problem was corrected in Microsoft Visual C++ .NET.
MORE INFORMATION
Steps to Reproduce Behavior
- Open a C++ project in Developer Studio.
In one of the source files, declare the following global variable:
CDerivedTest g_Test;
Position the cursor above this declaration, and begin defining the CDerivedTest class as follows:
class CDerivedTest : public CBaseTest
RESULTS: Before finishing the first line of the class definition, Developer Studio will exit without warning.
In this example, writing the CDerivedTest class definition first avoids the problem.
REFERENCES
For additional information, please see the following article(s) in the Microsoft Knowledge Base:
153284 INFO: Limitations of IntelliSense in Visual C++ 6.0
Keywords: kbbug kbfix kbnoupdate kbide kbdevstudio KB193477