Problem with List Control in visual c++

Hi everyone! I have problem using list control in visual c++. I tried to create a table which appears on a dialog window but when I run the executable on dialog appears only an empty "window" without the data I wrote. I used the "report view". Here is the code:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  void CDataDialog::OnLvnItemchangedStoreItems(NMHDR *pNMHDR, LRESULT *pResult)
{

	LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
	// TODO: Add your control notification handler code here
	*pResult = 0;
	//SetIcon(m_hIcon, TRUE);         // Set big icon
	//SetIcon(m_hIcon, FALSE);         // Set small icon

									 // TODO: Add extra initialization here
									 // Ask Mfc to create/insert a column
	m_StoreItems.InsertColumn(
		0,              // Rank/order of item 
		L"ID",          // Caption for this header 
		LVCFMT_LEFT,    // Relative position of items under header 
		100);           // Width of items under header

	m_StoreItems.InsertColumn(1, L"Resistivity", LVCFMT_CENTER, 80);
	m_StoreItems.InsertColumn(2, L"Permeability", LVCFMT_LEFT, 100);
	m_StoreItems.InsertColumn(3, L"Rdc", LVCFMT_LEFT, 80);

	int nItem;

	nItem = m_StoreItems.InsertItem(0, L"1");
	m_StoreItems.SetItemText(nItem, 1, L"0.000869");
	m_StoreItems.SetItemText(nItem, 2, L"1");
	m_StoreItems.SetItemText(nItem, 3, L"0.09136");

	nItem = m_StoreItems.InsertItem(0, L"2");
	m_StoreItems.SetItemText(nItem, 1, L"0.0008603");
	m_StoreItems.SetItemText(nItem, 2, L"1");
	m_StoreItems.SetItemText(nItem, 3, L"0.09136");

	nItem = m_StoreItems.InsertItem(0, L"3");
	m_StoreItems.SetItemText(nItem, 1, L"0.000869");
	m_StoreItems.SetItemText(nItem, 2, L"1");
	m_StoreItems.SetItemText(nItem, 3, L"0.09136");
	//return TRUE;
	
}



1
2
3
4
5
6
7
8
void CInputView::OnLinefeaturesData()
{
	// TODO: Add your command handler code here
	CInputDoc* pDoc = GetDocument();
	CDataDialog DialogWindow;
	DialogWindow.DoModal();

}
Last edited on
Topic archived. No new replies allowed.