?
Solved

MFC Splash Screen

Posted on 2000-02-24
5
Medium Priority
?
989 Views
Last Modified: 2013-11-20
I've created an SDI application in Visual C++ 6.0.  I've added a splash screen component.  But when i run the application the main window opens then the splash screen.  I want the splash screen to open then go away and then the main application to open. Any help would be appreciated.

Thanks
0
Comment
Question by:Yozzer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 31

Expert Comment

by:Zoppo
ID: 2554034
Hi Yozzer,

In InitInstance() do following

// after this line
CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash);
// add this lines
CSplashWnd::ShowSplashScreen(NULL);
Sleep( 750 ); // see the value passed to SetTimer in CSplashWnd::OnCreate

and remove from CMainFrame::OnCreate() the line
CSplashWnd::ShowSplashScreen(NULL);

hope that helps,

ZOPPO
0
 
LVL 8

Accepted Solution

by:
VinExpert earned 150 total points
ID: 2554035
Hi,

Do this in the InitInstance of the app class after the call to AfxEnableControlContainer(); in the initinstance start

      CSplashWnd* pSplashWnd = new CSplashWnd;
      pSplashWnd->EnableSplashScreen(TRUE);
      pSplashWnd->ShowSplashScreen(m_pMainWnd);
      Sleep(2500);

For this open the Splash.h and make the constuctor as public

Hope this helps.
VinExpert


0
 

Author Comment

by:Yozzer
ID: 2554349
Thanks Zoppo and VinExpert

Both ways worked
0
 
LVL 3

Expert Comment

by:akalmani
ID: 2554365
Hi !!
        U r splash window component should be assigned as the main window and then show the splash window. Sleep for some time and then reassign the main window as u r SDI. That will solve the problem.
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 2554377
:(
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question