Modal
1)Run application wizard(exe)->SDI->Project name and location.
2)Create dialog resource IDD_DIALOG1 and dialog class projdialog
3)Define OnLButtonDown->click view.cpp
4)Define InitDialog
5)Execute.
CODE:
Modaldialogview.cpp
#include “resource.h”
#include "projdialog.h"
void CModView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
Moddialog dlg;
dlg.DoModal();
CView::OnLButtonDown(nFlags, point);
}
projdialog.cpp
#include “resource.h”
#include "projdialog.h"
BOOL projdialog::OnInitDialog()
{
CListBox *plb=(CListBox*)GetDlgItem(IDC_LIST1);
plb->InsertString(-1,"ece");
plb->InsertString(-1,"it");
plb->InsertString(-1,"eee");
plb->InsertString(-1,"cse");
return TRUE;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment