The information in this article applies to:
SYMPTOMS
This article discusses some of the limitations of IntelliSense when working
with classes. The following problems are addressed:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATIONThe following is a code sample that illustrates the limitations described in this article. This sample should be placed into a header file:
Create a Visual C++ MFC project, and include the header file above into a
source file.
Class Constructors Do Not Activate Parameter InfoType the following line of code into the source file:
Notice that no Parameter Info appears for the optional parameter "n" in the
class constructor.
Private Members Display in Members List Outside the Class DefinitionType the following lines of code into the source file:
The Members list for the CIntelliSense class should appear after typing the
period. Notice that it contains the PrivateFunction member function and the
Num member variable.
Although these functions and variables appear in the Members list, they will generate a compiler error C2248 if used. Private member variables and functions can not be used outside of the class in which they are defined. IntelliSense May Not Recognize Standard Win32 Data Types in Member Functions When Default Parameters Are UsedType the following lines of code into the source file:
Notice that only the first DWORD parameter appears in the Parameter Info
for this function. IntelliSense does not provide Parameter Info for the
second parameter of this function.
When an unknown data type is used in a member function parameter list, IntelliSense stops parsing the function at that point. At times, IntelliSense does not recognize Win32 data types as valid data types when used in member functions. This is related to the use of default parameters, and it causes Parameter Info and Type Info to generate a truncated list of function parameters. The only way to avoid this problem is to use the data type outside of a default parameter list before it is used in the member function. This has to occur in the same file that contains the class definition. The following is a workaround:
IntelliSense Does Not Recognize the Member Functions of a Few New MFC Classes, such as CIPAddressCtrl, CMonthCalCtrl, CRebar, and CRebarCtrlIn the CIntelliSense::MFCProblem function, enter a new line after the instantiation of the CMonthCalCtrl object. Insert the following code:
The Members list will appear, but it does not include the member functions
for CmonthCalCtrl; however, it does include the members for the CWnd class.
REFERENCESFor additional information, please see the following article in the Microsoft Knowledge Base: Q153284 Limitations of IntelliSense in Visual C++ 6.0"About Automatic Statement Completion;" Visual C++ Documentation, Using Visual C++, Visual C++ Users Guide, Text Editor, Overview: Text Editor, About Automatic Statement Completion. "Automatically Completing Statements;" Visual C++ Documentation, Using Visual C++, Visual C++ Users Guide, Text Editor, How do I ... Topics: Text Editor, Automatically completing Statements. Additional query words: kbvc600
Keywords : |
Last Reviewed: July 19, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |