CompuServe Thread

#CDialog startup

5 messages in this thread
#30439From: Pat ColladoJul 10, 1994 8:11 PM
I have a dialog that I use when I load my files. It informs the user of where in the file it is because some of the files are big. I call the dialog after the CFileDialog returns a filename. Problem is there seems to be no code (or messages) that are called after a Dialog box is opened,painted, and just waiting. If I put the file input code in ShowWindow, the dialog does not paint in time. If I put it in OnPaint, the dialog gets painted, but buttons do not, and if an error occurs while loading the file and one moves the message box, the file input status dialog box goes to repaint itself and I GPF. Where do I attach my file read code so that the dialog automatically executes it upon loading itself and painting itself? Thanks Pat Collado
#30539From: Kit KauffmannJul 11, 1994 1:48 PM
Perhaps I've misunderstood, but OnInitDialog is the traditional place for such things… Kit
#30598From: Pat ColladoJul 11, 1994 9:27 PM
The problem with OnInitDialog is that it is called before ShowWindow. Everything that goes on it OnInitDialog takes place before the Dialog is drawn. I want the Dialog to load,draw itself, and then call a routine to load a file that then draws to the dialog what it's doing. I believe OnInitDialog is for variable first time initialization and window placement,etc. Thanks though. Any other ideas? Pat
#30639From: Thomas Zeisluft [MVP]Jul 12, 1994 2:57 AM
Pat, PMFJI, try posting a user-defined message to yourself at OnInitDialog ( WM_USER + 2 or bigger ). When you get this message, the dialog should be visible. You can also set up a timer. ThomasZ
#30653From: Pat ColladoJul 12, 1994 7:12 AM
Thanks. I have yet to learn user-defined messages. That is my goal for the evening. I want to try an avoid doing such things as using a timer. By the way, what is PMFJI? I see alot of that stuff. Thanks! Pat Collado