HI,
I am trying to create a dialog. I have a .EXE which already as its Dialog and this dialog is create with the function DoModal(). This EXE loads my dll. and at some point my dll needs to lauch a modeless dialog... I have tried the following:
DlgPtr = new DlgClass();
DlgPtr->Create( IDD_FIRST_DIALOG );
DlgPtr->ShowWindow( SW_SHOW );
But this does not work. It pops up the dialog but its all grey and the hour glass is on it. making my entire app not function.
Thanks for any help!
maldini

Dialog + Modeless
AndyL
Use DoModal. You can not create a dialog without allowing message to be processed.
TheSun
thx
maldini
ISW
What do you want to do
DanielAnywhere
Modeless dialogs work perfect if you have a message loop in your thread that permanently pumps the the messages and deliver them.
I.e a modeless box is something like a search/replace dialog in an editor.
But your process/thread didn't have a message loop. More extrem its permanently excutes code. So window message doesn't get processed. So no window can live under such a situation. They wont get painted or will never react on user input.
Painting and use input forces the existance of an active message loop!
HTH
Siggi Bjarnason
mam6669
What i really have is a state machine!!!,,,At some event sent from the main EXE, my dll which is realy a state machine must display a dialog which contains some activeXs and some buttons.. So after i do the Create and the ShowWindow... I basically do some small configuration and then go back to idle state awaiting for another message form the EXE..
I am not too familliar with message loop, is that what I need. If so how to I go about setting one up...
Thanks for the help in advance.
maldini
breed
Is this OK , Is it good programming practice, If so whats the point of having a modeless Dialog. I have an EBOOK "Programming Windows with MFC" by Jeff Prosise. And there is a section about modeless Dialog
Quote from the book
"
Modeless Dialog Boxes
Once you've mastered modal dialog boxes, you'll discover that modeless dialog boxes are just a variation on what you've already learned. Modal and modeless dialog boxes are more alike than they are different. The key differences between them include the following:
There are other differences between modal and modeless dialog boxes that MFC handles for you........"
Thanks alot for the help Maritn, It is really appriciated.
maldini