PHP Code:
//
// In your view (or document, or frame, etc.)
//
CMyView::OnDialogBox()
{
  
CMyDialog dlg(GetDocument());
  
dlg.DoModal();
}

//
// In your dialog box header file:
//
class CMyDocument;

class 
CDialog : public CDialog
{
  
// Modify the normal constructor
  
CMyDialog(CMyDocument *pDocCWnd *pParent=NULL);
  
// Don't allow default constructor
  
CMyDialog(){ ASSERT(FALSE); }

protected:
  
CMyDocument *m_pDoc;
}

//
// In your dialog box cpp file
//
CMyDialog::CMyDialog(CMyDocument *pDocCWnd *pParent/*=NULL*/)
  :: 
CDialog(CMyDialog::IDD,pParent), m_pDoc(pDoc)
{