新手求助:error C1004: unexpected end of file found
貌似也沒有語法錯誤,怎麼會有這樣的問題?請各位高手幫忙!出錯提示如下:
e:\study\qq\qq.cpp(7) : error C2146: syntax error : missing ';' before identifier 'bb'
e:\study\qq\qq.cpp(7) : fatal error C1004: unexpected end of file found
代碼如下:
extern CString bb;
void CAboutDlg::OnKillFocus(CWnd* pNewWnd)
{
// TODO: Add your message handler code here
CDialog::OnKillFocus(pNewWnd);
bb=m_edit;
}
//對于OICQVIEW類
char aa[100];
CString mm;
CDC* pdc;
class mysock:public CSocket //派生mysock類,此類既有接受功能
{public:void OnReceive(int nErrorCode) //可以隨時接收信息
{
CSocket::Receive((void*)aa,100,0);
mm=aa;
CString ll=" "; //在顯示消息之前,消除前面發送的消息
pdc->TextOut(50,50,ll);
pdc->TextOut(50,50,mm);
}
};
mysock sock1;
CString bb;
BOOL COicqView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
CView::OnSetFocus(pOldWnd);
// TODO: Add your message handler code here and/or call default
bb="besting:"+bb; //确定發送者身份為besting
sock1.SendTo(bb,100,1060,"192.168.0.255",0); //獲得焦點以廣播形式發送信息,端口號為1060
return CView::OnSetCursor(pWnd, nHitTest, message);
}
int COicqView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
sock1.Create(1060,SOCK_DGRAM,NULL);//以數据報形式發送消息
static CClientDC wdc(this); //獲得當前視類的指針
pdc=&wdc;
// TODO: Add your specialized creation code here
return 0;
}