我在一篇文章上看到如何让对话框有起动画面,但我在编译时却报警,提是如下:(绝对没打有打错代码)
temp\Ddd\DDD.cpp(46) : error C2653: 'CSplashWnd' : is not a class or namespace name
E:\vc temp\Ddd\DDD.cpp(46) : error C2065: 'EnableSplashScreen' : undeclared identifier
DDDDlg.cpp
E:\vc temp\Ddd\DDDDlg.cpp(179) : error C2653: 'CSplashWnd' : is not a class or namespace name
E:\vc temp\Ddd\DDDDlg.cpp(179) : error C2065: 'ShowSplashScreen' : undeclared identifier
temp\Ddd\DDD.cpp(46) : error C2653: 'CSplashWnd' : is not a class or namespace name
E:\vc temp\Ddd\DDD.cpp(46) : error C2065: 'EnableSplashScreen' : undeclared identifier
DDDDlg.cpp
E:\vc temp\Ddd\DDDDlg.cpp(179) : error C2653: 'CSplashWnd' : is not a class or namespace name
E:\vc temp\Ddd\DDDDlg.cpp(179) : error C2065: 'ShowSplashScreen' : undeclared identifier
VC自带的。
黄向明所写的文章,方法如下:
.将Splash.cpp和Splash.h两个文件从Hs工程中拷贝到你的工 程中。添加如下代码到CSplaApp的InitInstance()函数中。 #include “Splash.h”
// 头 文 件 请 放 在 开 始 位 置
BOOL CSplaApp::InitInstance()
{
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
CSplashWnd::EnableSplashScreen(cmdInfo.m_bShow
Splash);
...
}2. 接下来, 使用ClassWizard来添加OnCreate函数到你的对话 框类中,并且添加如下代码: #include “Splash.h”
// 头文件请放在开始位置
int CSplaDlg::OnCreate
(LPCREATESTRUCT lpCreateStruct)
{
...
CSplashWnd::ShowSplashScreen(this);
...
}3.将Splash16.bmp文件从Hs工程中拷贝到你的工程中。打开Workspace 的Resouce项,将Splash16.bmp插入。打开Properties将IDB_BITMAP1改为IDB_SPLASH, 这个ID值只要和程序中一致起来就行,现在这样改最 简便。