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

Thread: CDialog not getting closed in one click

  1. #1
    Join Date
    Oct 2019
    Posts
    36

    CDialog not getting closed in one click

    I have created a dialog (class derived from CDialog) and having one OK button in it.Problem is sometimes dialog dont get close in one go when ok button is pressed.I have debugged the code ,destructor of dialog class is getting properly called,I have also used OnDestroy() method and ON_WM_DESTROY() message.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,543

    Re: CDialog not getting closed in one click

    Is it a modal or modeless dialog?Is you application a single- or multithreaded?
    How does you dialog's OnOK() look like?
    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2019
    Posts
    36

    Re: CDialog not getting closed in one click

    It is a Modal Dialog..Application is Single threaded. Code for OnOK() is as follows:
    Code:
    Void handleOK()
    {
    CDialog::OnOK();
    }
    Note: handleOk has been declared in header file and also mapped with IDOK in message map.

  4. #4
    Arjay's Avatar
    Arjay is online now Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,146

    Re: CDialog not getting closed in one click

    Quote Originally Posted by Beginner_MFC View Post
    It is a Modal Dialog..Application is Single threaded. Code for OnOK() is as follows:
    Code:
    Void handleOK()
    {
    CDialog::OnOK();
    }
    Note: handleOk has been declared in header file and also mapped with IDOK in message map.
    Put a breakpoint in the method, press F5 to start debugging and see if the breakpoint gets hit when you click the OK button.

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)