Click here to Skip to main content
15,899,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Program to find sum of digits of a number . Please help with logical error of program. Pin
CPallini27-Jul-14 21:21
mveCPallini27-Jul-14 21:21 
GeneralRe: Program to find sum of digits of a number . Please help with logical error of program. Pin
Stefan_Lang27-Jul-14 23:49
Stefan_Lang27-Jul-14 23:49 
GeneralRe: Program to find sum of digits of a number . Please help with logical error of program. Pin
CPallini27-Jul-14 23:56
mveCPallini27-Jul-14 23:56 
GeneralRe: Program to find sum of digits of a number . Please help with logical error of program. Pin
Satya Chamakuri8-Aug-14 22:52
Satya Chamakuri8-Aug-14 22:52 
QuestionCan some one please tell me how to insert items into a friggin CListCtrl Pin
Member 1095872124-Jul-14 7:57
Member 1095872124-Jul-14 7:57 
AnswerRe: Can some one please tell me how to insert items into a friggin CListCtrl Pin
tagopi24-Jul-14 19:21
tagopi24-Jul-14 19:21 
AnswerRe: Can some one please tell me how to insert items into a friggin CListCtrl Pin
Richard MacCutchan24-Jul-14 20:41
mveRichard MacCutchan24-Jul-14 20:41 
GeneralRe: Can some one please tell me how to insert items into a friggin CListCtrl Pin
Member 1095872128-Jul-14 23:55
Member 1095872128-Jul-14 23:55 
I have been reading the documentation - where else do you think I obtained those methods that I have been trying.

This is what I have tried precisely.
And function
VB
int InsertItem(
   int nItem,
   LPCTSTR lpszItem

,as described here (http://msdn.microsoft.com/en-us/library/8b9s12fc.aspx[^]), DOES NOT WORK The function does nothing. WHY?

Can you only add items to a CListCtrl via
VB
int InsertItem(
   const LVITEM* pItem
);
and the function that I have been using is in fact defunct?


void CImageDialog::DDX_List(CDataExchange* pDX, UINT uListCtrlID, CStringArray& rarrayOtherImgFiles)
{
	CListCtrl* pListCtrl = (CListCtrl*)GetDlgItem(uListCtrlID);
	int nI = 0;
	CString strItem;

	ASSERT_VALID(pListCtrl);

	if (pDX->m_bSaveAndValidate)
	{
		m_arrayOtherImageFiles.RemoveAll();
		for (nI = 0; nI < pListCtrl->GetItemCount(); nI++)
		{
			strItem = pListCtrl->GetItemText(nI, 0);
			m_arrayOtherImageFiles.Add(strItem);
		}
	}
	else
	{
		pListCtrl->DeleteAllItems();
		for (nI = m_arrayOtherImageFiles.GetCount() - 1; nI >= 0; nI--)
		{
			pListCtrl->InsertItem(1, m_arrayOtherImageFiles.GetAt(nI));
		}
	}
}
	
void CImageDialog::DoDataExchange(CDataExchange* pDX)
{
	CMyDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_EDIT_HEADER_IMG, m_strHeaderImageFile);
	DDX_Text(pDX, IDC_EDIT_NAV_IMG1, m_strNavImg1File);
	DDX_Text(pDX, IDC_EDIT_NAV_IMG2, m_strNavImg2File);
	DDX_Text(pDX, IDC_EDIT_OTHER_IMG_FILES, m_strOtherImgFiles);
	DDX_List(pDX, IDC_LIST_OTHER_IMG_FILES, m_arrayOtherImageFiles);
}

GeneralRe: Can some one please tell me how to insert items into a friggin CListCtrl Pin
Richard MacCutchan29-Jul-14 5:16
mveRichard MacCutchan29-Jul-14 5:16 
Questionhow to generate text file for a program output? Pin
mybm124-Jul-14 0:41
mybm124-Jul-14 0:41 
AnswerRe: how to generate text file for a program output? Pin
Richard MacCutchan24-Jul-14 1:07
mveRichard MacCutchan24-Jul-14 1:07 
GeneralRe: how to generate .txt file as output dynamic for this program? Pin
mybm124-Jul-14 1:47
mybm124-Jul-14 1:47 
GeneralRe: how to generate .txt file as output dynamic for this program? Pin
Richard MacCutchan24-Jul-14 2:05
mveRichard MacCutchan24-Jul-14 2:05 
GeneralRe: how to generate text file for a program output? Pin
mybm124-Jul-14 2:05
mybm124-Jul-14 2:05 
GeneralRe: how to generate text file for a program output? Pin
Richard MacCutchan24-Jul-14 2:11
mveRichard MacCutchan24-Jul-14 2:11 
GeneralRe: how to generate text file for a program output? Pin
mybm124-Jul-14 18:47
mybm124-Jul-14 18:47 
GeneralRe: how to generate text file for a program output? Pin
Richard MacCutchan24-Jul-14 20:35
mveRichard MacCutchan24-Jul-14 20:35 
AnswerRe: how to generate text file for a program output? Pin
CPallini24-Jul-14 2:46
mveCPallini24-Jul-14 2:46 
GeneralRe: how to generate text file for a program output? Pin
mybm124-Jul-14 18:49
mybm124-Jul-14 18:49 
GeneralRe: how to generate text file for a program output? Pin
mybm127-Jul-14 20:49
mybm127-Jul-14 20:49 
GeneralRe: how to generate text file for a program output? Pin
CPallini27-Jul-14 21:25
mveCPallini27-Jul-14 21:25 
Questionhow to display specific file in a folder using c program in ubuntu? Pin
mybm123-Jul-14 20:43
mybm123-Jul-14 20:43 
AnswerRe: how to display specific file in a folder using c program in ubuntu? Pin
mybm123-Jul-14 20:44
mybm123-Jul-14 20:44 
GeneralRe: how to display specific file in a folder using c program in ubuntu? Pin
Richard MacCutchan23-Jul-14 22:11
mveRichard MacCutchan23-Jul-14 22:11 
GeneralRe: how to display specific file in a folder using c program in ubuntu? Pin
mybm123-Jul-14 23:10
mybm123-Jul-14 23:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.