using SetDlgItemInt function

I want to set an integer into my edit control (IDC_EDIT1).
When i press left mouse button on client window, it will generate a dialog box with an edit control with a number i set up in CView class. I use this code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
void CdocViewView::OnLButtonDown(UINT nFlags, CPoint point)
{
	int i,j;
	CView::OnLButtonDown(nFlags, point);
	pos = point;
	
	//SetDlgItemInt
	dialg.SetDlgItemInt(IDC_EDIT1, j);
	dialg.SetDlgItemInt(IDC_EDIT2, locationX);
	dialg.SetDlgItemInt(IDC_EDIT3, locationY);

	if(dialg.DoModal()==IDOK)
	{
				
		
	}	
	
}


Dialg is mydialog object. This can't show the dialog in fact.
It only shows when i use SetDlgItemInt inside dialog class. I confuse why only SetWindowtext can show

1
2
3
4
5
6
7
8
9
void CEditDialog::OnBnClickedButton1()
{
	// TODO: Add your control notification handler code here
	SetDlgItemInt(IDC_EDIT3, 20);// it shows the integer
        m_slctd_crdt.SetWindowTextW(_T("Hallo"));
	//m_slctd_crdt.SetDlgItemText(IDC_EDIT2, _T("Hallo")); cannot show
       // m_Editnumber.SetDlgItemInt(IDC_EDIT1, 100); cannot show.

}

Later i know, that i should use SetDlgItemInt function. How to declare this function? and how to declare a handle to dialog box? If you dont mind give me any references


Topic archived. No new replies allowed.