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
Solved

MFC Splash Screen

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

860 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