Solved

MFC Splash Screen

Posted on 2000-02-24
5
937 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
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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 91
dog bark java program 15 87
sum13 challenge 24 90
Not needed 13 93
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: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now