CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1

    How to paint a CDialog - object without calling DoModal?



    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

  2. #2
    Join Date
    Apr 1999
    Posts
    24

    Re: How to paint a CDialog - object without calling DoModal?



    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.

  3. #3

    Re: How to paint a CDialog - object without calling DoModal?



    Many thanks, it works fine!

  4. #4
    Join Date
    Nov 1999
    Location
    India,MUMBAI
    Posts
    6

    Re: How to paint a CDialog - object without calling DoModal?

    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);


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured