Solved

MFC Splash Screen

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sameEnds challenge 3 160
method notes when mouse over in eclipse 5 87
zeroFront challenge 7 99
canBalance challenge 34 85
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

777 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