Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Idle in a Dialog Box? [MFC]

This topic is 6350 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For my current project I need to create a loading dialog. Thing is I need to create a dialog that will display.. then have a function called... then quit.. I find out how to do this.. Anyone have any ideas?

Share this post

Link to post
Share on other sites
You just create a dialog resource, wap ctrl-w make a new dialog class, and include the header file in your main app. Add the function you want to the new dialog class.

The trick is you need to creat a "modeless" dialog, and instead of calling .DoModal you just call .Show(SW_SHOW) and then the main program will launch. Once that happens you whack the dialog.

Magmai Kai Holmlor
- Not For Rent

Share this post

Link to post
Share on other sites
Well, now I have a Assertion Error..

Assert Failed

I can't figure it out..

Edited by - Galileo430 on July 24, 2001 2:07:23 PM

Share this post

Link to post
Share on other sites
Did you create your dialog before calling Show()? if IsWindow fails, it oftn means the object either was never created or has gone out of scope.

Actually, backing up to your first post, you want to create a "Loading..." dialog box, no? You want it to quit after the function returns, right? Perhaps the dialog is being destroyed before the function ends (depends on how you call the function - inside the dialog?), and your reference to the dialog object after that is to an invalid object. Try this:
class CLoadingDlg : public CDialog()
void CallFuction( void * ); // uses function pointer to call actual function

void LoadData( void );
CLoadingDlg dlg;
dlg.Show(SW_SHOW); // inherit CDialog functionality

dlg.CallFuntion( LoadData );
dlg.Show(SW_HIDE); // SW_? can't remember

// now either allow dlg to go out of scope or explicitly call destructor

Hope it helps.

Edited by - Oluseyi on July 24, 2001 2:34:36 PM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!