Skip to main content
Email Password   helpLost your password?

This article is part of the drag and drop interface samples.

  1. Serializing ASCII Data
  2. Modeless child dialog
  3. Modeless sibling dialog
  4. The drag source
  5. The MFC drop target
  6. The TBTextTarget class

  • Download source files - 44 Kb

    To create the modeless dialog as sibling, follow this link.

    Follow these steps:

    1. Create a new dialog resource and use the Class Wizard for making a new CDialog based class for it; let's call it CDropDialog
    2. In your CFormView-derived class, add a (private) member variable of type CDropDialog* as a container for the modeless dialog class, let's call it m_pModeless. In the constructor of your view, make sure you initialize m_pModeless to NULL
    3. In your appropriate message handler, let's call it OnModeless, do the following:
      void CInterfaceView::OnModeless() 
      {
          // Display the modal dialog box
      
          if (!m_pModeless)
              m_pModeless = new CDropDialog;
      
          if (!::IsWindow(m_pModeless->GetSafeHwnd()))
              m_pModeless->Create(IDD_DIALOG1, this);
      
          m_pModeless->ShowWindow(SW_SHOW); 
      }
    In the destructor of the parent window, proof if the dialog has been closed and release the memory:
    CInterfaceView::~CInterfaceView()
    {
        if (m_pModeless)
        {
            if (::IsWindow(m_pModeless->GetSafeHwnd()))
                m_pModeless->EndDialog(IDCANCEL);
            delete m_pModeless;
        }
    }
  • You must Sign In to use this message board.
     
     
    Per page   
     FirstPrevNext
    QuestionModeless Dialog boxes Pin
    ksrikant83
    20:42 2 Jul '08  
    Generalare you suppose to be able to type data in text box?? Pin
    doctorrie
    9:30 23 May '05  
    GeneralRe: are you suppose to be able to type data in text box?? Pin
    cristitomi
    5:32 22 Mar '07  
    GeneralControls on child dialog are not enabled - Solution! Pin
    Stephen_Hosking
    17:15 29 Mar '05  
    GeneralIf this doesn't work for you... Pin
    Steve (Stephen Hosking)
    17:24 29 Mar '05  
    Generaldialog style as Child but always disabled Pin
    wondermind
    13:20 13 Oct '04  
    GeneralSee "Solution", 30 March 2005. nt Pin
    Steve (Stephen Hosking)
    17:19 29 Mar '05  
    GeneralRe: dialog style as Child but always disabled Pin
    cristitomi
    5:33 22 Mar '07  
    GeneralModeless dialoge Pin
    sohcher@harandiha.com
    11:20 26 Feb '04  
    Generalusing database Pin
    vishalbhatara
    0:49 5 May '03  
    GeneralHow 2 call a dialog using a button Pin
    Biswakalyan
    0:05 17 Jun '02  
    GeneralRe: How 2 call a dialog using a button Pin
    Anonymous
    6:07 2 Nov '02  
    Generalfront window Pin
    tammari
    22:20 8 May '02  
    GeneralRe: front window Pin
    walker
    0:19 13 May '02  
    GeneralRe: front window Pin
    DarkCloud14
    12:39 9 Dec '03  
    GeneralDetected memory leaks!! Pin
    Anonymous
    23:11 8 Apr '02  
    GeneralJumping between several dialogs Pin
    MIG29
    13:57 29 Jul '01  
    GeneralHEELLLPPPPP Pin
    Anonymous
    10:14 10 Jul '01  
    GeneralRe: HEELLLPPPPP Pin
    Anonymous
    10:44 10 Jul '01  
    GeneralHELP!! SAME PROBLEM HERE TOO Pin
    wondermind
    10:32 13 Oct '04  
    GeneralIf I set the dialog style to Child, it is not enabled Pin
    David Fleming
    23:15 14 Jun '01  
    GeneralRe: If I set the dialog style to Child, it is not enabled Pin
    Nice Özgürce
    13:09 18 Jan '05  
    GeneralOnModeless Pin
    Julien
    12:35 4 Jan '01  
    GeneralRe: OnModeless Pin
    Julien
    12:46 4 Jan '01  
    GeneralEndDialog()?... must be DestroyWindow(). Pin
    gon(junggon Kim)
    21:22 15 Nov '00  


    Last Updated 9 Nov 2000 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009