| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 700 人关注过本帖
标题:[求助]实在是找不出错误
只看楼主 加入收藏
xialup
Rank: 1
等 级:新手上路
帖 子:84
专家分:0
注 册:2006-3-20
收藏
 问题点数:0 回复次数:3 
[求助]实在是找不出错误

E:\实例\Communication\CommunicationDlg.cpp(229) : error C2601: 'OnChangeTitle' : local function definitions are illegal
E:\实例\Communication\CommunicationDlg.cpp(252) : error C2601: 'OnTimer' : local function definitions are illegal
E:\实例\Communication\CommunicationDlg.cpp(264) : error C2601: 'OnAddToTray' : local function definitions are illegal
E:\实例\Communication\CommunicationDlg.cpp(278) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

void CCommunicationDlg::OnChangeTitle()
{
CTime time;
CString strWeek;
CString strTime;
CString strCaption;
time=CTime::GetCurrentTime();
strTime=time.Format("%Y-%m-%d");
switch(time.GetDayOfWeek())
{
case 1: strWeek = "礼拜天" ;break;
case 2: strWeek = "礼拜一" ;break;
case 3: strWeek = "礼拜二" ;break;
case 4: strWeek = "礼拜三" ;break;
case 5: strWeek = "礼拜四" ;break;
case 6: strWeek = "礼拜五" ;break;
case 7: strWeek = "礼拜六" ;break;
}
AfxGetMainWnd()->GetWindowText(strCaption);
strCaption+="[今天是:" + strTime +"--"+strWeek+"]";
AfxGetMainWnd()->SetWindowText(strCaption);
}

void CCommunicationDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CTime time;
CString strTime;
time=CTime::GetCurrentTime();
strTime=time.Format("%H : %M : %S");
m_bar.SetPaneText(1,strTime);
m_bar.SetPaneText(0,"********");
CDialog::OnTimer(nIDEvent);
}

BOOL CCommunicationDlg::OnAddToTray()
{
HICON hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
m_nc.cbSize = sizeof(NOTIFYICONDATA);
m_nc.hWnd = GetSafeHwnd();
m_nc.uID = 0;
m_nc.hIcon = hIcon;
m_nc.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
m_nc.uCallbackMessage = WM_TRAY_NOTIFY;
CString strTip;
GetWindowText(strTip);
strcpy (m_nc.szTip, strTip);
// Set the tray icon
Shell_NotifyIcon(NIM_ADD, &m_nc);
} //E:\实例\Communication\CommunicationDlg.cpp(278) : fatal error C1004: unexpected end of file found
帮帮忙吧~~ 谢了先~~

搜索更多相关主题的帖子: cpp 实例 function definitions 
2006-07-06 11:53
xialup
Rank: 1
等 级:新手上路
帖 子:84
专家分:0
注 册:2006-3-20
收藏
得分:0 

头文件:

#include "stdafx.h"
#include "Communication.h"
#include "CommunicationDlg.h"
#define WM_TRAY_NOTIFY (WM_USER+33)

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


2006-07-06 11:53
xialup
Rank: 1
等 级:新手上路
帖 子:84
专家分:0
注 册:2006-3-20
收藏
得分:0 
哪位DX过来指点一二?

2006-07-06 13:29
aogun
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:638
专家分:0
注 册:2006-4-5
收藏
得分:0 
代码不全,请贴出所有该文件代码
从当前的信息看来比较像你的括号不对齐

世界上总共有 10 种人,一种懂得什么是二进制 ,一种不懂。
2006-07-06 13:57
快速回复:[求助]实在是找不出错误
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030304 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved