Click to See Complete Forum and Search --> : How to paint a CDialog - object without calling DoModal?


Andreas Richter
March 30th, 1999, 02:15 AM
I have created a dialog - box with my resource construction kit. Now I want to show or hide this object relating to program - structure. I dont want to use the DoModal-function, because this function waits for user - action (there is no user - editable part inside at all).


Is there a possibility to create, draw and clear this object without using DoModal? Can I handle the CDialog - object like a CWnd - Object and attach it as a child to my mainwindow?


The other possiblity I think is to leave the DoModal function with creating a message-map and getting a timer - message. So I can insert my cade - parts and end the dialog with EndDialog(). But what kind of message must I wait for? Is there a WM - Message or somewhat which makes it able to jump immediately (milliseconds or so :-)) ) to my code??


Best regards


Andreas

Dazza
March 30th, 1999, 08:20 AM
It sounds as if you need a modeless dialog, so try calling CDialog::Create() rather than DoModal(). This will allow you to treat it like a CWnd object.

Andreas Richter
March 30th, 1999, 11:41 AM
Many thanks, it works fine!

kanojiajogesh
November 29th, 1999, 08:32 AM
Create modeless Dialog
1)Create a Dialog
2)Create a new class to this dialog
3)create a MV associated with your dialog class in your View class
4) Add header file of your dialog class in your view class header file

call Create method to the MV of dialog
and then call
ShowWindow(SW_SHOW);