我在一篇文章上看到如何让对话框有起动画面,但我在编译时却报警,提是如下:(绝对没打有打错代码)
 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

解决方案 »

  1.   

    赶快把 #include "SplashWnd.h" 加进 DDD.CPP!VC 已经报警,再不抓紧你就到监狱去渡几天假吧。:-)
      

  2.   

    edyang兄,不行啊!我刚试过,还是同样问题。why?
      

  3.   

    你先创建一个SDI程序。导入SPLASHSCREEN组件。再把头文件“SPLASHSCREEN。H”加入你的程序。我是这样来得。不只你的行不行。
      

  4.   

    project->add to project->Component and control->Visual C++ Components->Splash screen->insert -> OK
    VC自带的。
      

  5.   

    你提到的类库CSplashWnd是个MFC的扩展类库吧!如果是如此,方法如shylake所做。把库加到项目。
      

  6.   

    感谢各位的关注,但我也是这么做的,试了N次,不行!我看的是南京海军指挥学院
    黄向明所写的文章,方法如下:
    .将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值只要和程序中一致起来就行,现在这样改最 简便。
      

  7.   

    你赶快把   #include   "Splash.h "   加进   DDD.CPP 中就可以,我试过了,可以