Running a function as the dialog starts
-
Hey, Probably a stupid question but how do I get a function to run after the dialog has loaded? The situation is I'm writing a mp3->wav converter where a dialog should load up with a progress bar and a couple of static text labels. I just want it to load the dialog then run the Decompress function without any user input at all. Putting the function call in initInstance just runs it before the dialog has loaded, and putting it in the constructor for the Dialog is causing an error in wincore.cpp. Any ideas how to fix this silly problem? thanks guys :)
-
Hey, Probably a stupid question but how do I get a function to run after the dialog has loaded? The situation is I'm writing a mp3->wav converter where a dialog should load up with a progress bar and a couple of static text labels. I just want it to load the dialog then run the Decompress function without any user input at all. Putting the function call in initInstance just runs it before the dialog has loaded, and putting it in the constructor for the Dialog is causing an error in wincore.cpp. Any ideas how to fix this silly problem? thanks guys :)
just show the dialog, don't call DoModal.
Back to real work : D-21.
-
just show the dialog, don't call DoModal.
Back to real work : D-21.
I'm not too sure what you're meaning I'm afraid. I got it wrong in my first post, I was called the dialogs initDialog() and not the initinstance function. do you mean changing the int nResponse = dlg.DoModal(); line in the app class? I tried changing that to dlg.ShowWindow(SW_SHOWNORMAL) but its giving errors :( Sorry to be a pain in the ass about this and thanks for your help
-
I'm not too sure what you're meaning I'm afraid. I got it wrong in my first post, I was called the dialogs initDialog() and not the initinstance function. do you mean changing the int nResponse = dlg.DoModal(); line in the app class? I tried changing that to dlg.ShowWindow(SW_SHOWNORMAL) but its giving errors :( Sorry to be a pain in the ass about this and thanks for your help
You've got plenty of modeless dialog code snippets on CodeProject to play with.
Back to real work : D-21.
-
Hey, Probably a stupid question but how do I get a function to run after the dialog has loaded? The situation is I'm writing a mp3->wav converter where a dialog should load up with a progress bar and a couple of static text labels. I just want it to load the dialog then run the Decompress function without any user input at all. Putting the function call in initInstance just runs it before the dialog has loaded, and putting it in the constructor for the Dialog is causing an error in wincore.cpp. Any ideas how to fix this silly problem? thanks guys :)
Pick a command ID, such as 100, then at the end of
OnInitDialog()
, callPostMessage ( WM_COMMAND, 100 );
Add a handler for that command ID to the dialog, and do the conversion in that handler. --Mike-- "alyson hannigan is so cute it's crazy" -- Googlism Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm
-
Pick a command ID, such as 100, then at the end of
OnInitDialog()
, callPostMessage ( WM_COMMAND, 100 );
Add a handler for that command ID to the dialog, and do the conversion in that handler. --Mike-- "alyson hannigan is so cute it's crazy" -- Googlism Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm