刚开始学了一点VC就遇到这个问题解决不了好打击人哦,帮帮我啊:) (50分)

G

geyufly

Unregistered / Unconfirmed
GUEST, unregistred user!
先是代码,问题写在后面:一定要帮帮忙
class CNetClientDlg : public CDialog
{
[red]// Construction[/red]public:
void OnCon();
CNetClientDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CNetClientDlg)
enum { IDD = IDD_NETCLIENT_DIALOG };
CString m_ServerAdd;
int m_ServerPort;
CString m_Status;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNetClientDlg)
protected:
virtual voiddo
DataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CNetClientDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnBconnect();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CMyScoket m_Connect;//[red]就是这个地方老是报syntax error : missing ';' before identifier 'm_Connect'
和'CMyScoket' : missing storage-class or type specifiers
到底是怎么回事吗?哎,CMyScoket是继承的CAsyncSocket[/red]};
 
#include "MySocket.h"
 
楼上说的那个INCLUDE我是写进去了的。
 
DECLARE_MESSAGE_MAP()????
是不是少了个;号?
呵呵,我猜的,
CMyScoket 你应该是单元没有加进去吧
 
仔细看一下是编译哪个CPP的时候出错的?
你把 #include "MySocket.h" 加到哪了? 是不是在NetClientDlg.h里?
如果是在某个CPP里那就可能是在其他用到NetClientDlg.h的CPP的编译的时候出错了.
因为你需要在每个用到NetClientDlg.h的CPP都加上#include "MySocket.h".
或者加到公用的头文件如StdAfx.h里.
 
总而言之是CMyScoket没有定义(VC 认为),慢慢的查吧,这个该死的vC很多时候不
那么守规矩
 
编译器已经提示得很清楚了,CMyScoket没有定义
 
多人接受答案了。
 
顶部