PRB: ClassWizard Doesn't Bring in Proper Header File (155133)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q155133 SYMPTOMS
After creating a new class derived from either CSocket or CAsyncSocket
using the ClassWizard, one of the following errors occur during
compilation:
error C2504: 'CSocket' : base class undefined
error C2504: 'CAsyncSocket' : base class undefined
CAUSE
ClassWizard allows you to derive a class directly from CSocket or
CAsyncSocket; however, it does not pull in the required header file where
these classes are declared. Therefore, the compiler displays an error
message reflecting that CSocket or CAsyncSocket was not defined.
RESOLUTION
Include the header file, afxsock.h, into your project, preferably in your
project's StdAfx.h header file:
...
#include <afxsock.h> //MFC support for Sockets
...
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 12/10/2003 |
---|
Keywords: | kbcode kbprb kbWinsock kbwizard KB155133 |
---|
|