Click here to Skip to main content
15,898,915 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMessage: Failed to set up the execution context to run the test. Pin
HaraldGalda31-Mar-17 2:16
professionalHaraldGalda31-Mar-17 2:16 
QuestionRe: Message: Failed to set up the execution context to run the test. Pin
David Crow31-Mar-17 5:23
David Crow31-Mar-17 5:23 
AnswerRe: Message: Failed to set up the execution context to run the test. Pin
zezba90003-Dec-18 9:30
zezba90003-Dec-18 9:30 
GeneralRe: Message: Failed to set up the execution context to run the test. Pin
David Crow3-Dec-18 10:21
David Crow3-Dec-18 10:21 
GeneralRe: Message: Failed to set up the execution context to run the test. Pin
zezba90003-Dec-18 10:59
zezba90003-Dec-18 10:59 
QuestionSave strings and integer in text file Pin
lolici25-Mar-17 11:01
lolici25-Mar-17 11:01 
SuggestionRe: Save strings and integer in text file Pin
David Crow25-Mar-17 11:12
David Crow25-Mar-17 11:12 
GeneralRe: Save strings and integer in text file Pin
lolici25-Mar-17 11:27
lolici25-Mar-17 11:27 
SuggestionRe: Save strings and integer in text file Pin
Premnath Mali14-Apr-17 1:40
professionalPremnath Mali14-Apr-17 1:40 
QuestionCMFCToolBarComboBoxButton dont work on some machines Pin
vojtee24-Mar-17 3:21
vojtee24-Mar-17 3:21 
SuggestionRe: CMFCToolBarComboBoxButton dont work on some machines Pin
Richard MacCutchan24-Mar-17 3:40
mveRichard MacCutchan24-Mar-17 3:40 
GeneralRe: CMFCToolBarComboBoxButton dont work on some machines Pin
vojtee24-Mar-17 3:46
vojtee24-Mar-17 3:46 
GeneralRe: CMFCToolBarComboBoxButton dont work on some machines Pin
Richard MacCutchan24-Mar-17 4:02
mveRichard MacCutchan24-Mar-17 4:02 
AnswerRe: CMFCToolBarComboBoxButton dont work on some machines Pin
_Flaviu9-Apr-17 21:53
_Flaviu9-Apr-17 21:53 
QuestionSave the content from List Control in text file vc++ Pin
lolici22-Mar-17 4:16
lolici22-Mar-17 4:16 
SuggestionRe: Save the content from List Control in text file vc++ Pin
David Crow22-Mar-17 4:48
David Crow22-Mar-17 4:48 
GeneralRe: Save the content from List Control in text file vc++ Pin
lolici22-Mar-17 5:23
lolici22-Mar-17 5:23 
I wrote this:
void CDataDialog::OnBnClickedOk()
{
	// TODO: Add your control notification handler code here
	//CDialog::EndDialog(0);
	CStdioFile file("over1.txt", CFile::modeCreate);

	int nCount = m_List.GetItemCount();
	for (int x = 0; x < nCount; x++)
	{
		CString strText = m_List.GetItemText(x, 0); // first column
		
		file.WriteString(strText);
	}

	file.Close();
	
}


and when execute it I get this statement: "Debug assertion failed". Is this because I already use CString CDataDialog::GetItemText(HWND hWnd, int nItem, int nSubItem) const??? Sorry I didn't mention it in the first post.

CString CDataDialog::GetItemText(
	HWND hWnd, int nItem, int nSubItem) const
{
	LVITEM lvi;
	memset(&lvi, 0, sizeof(LVITEM));
	lvi.iSubItem = nSubItem;
	CString str;
	int nLen = 128;
	int nRes;
	do
	{
		nLen *= 2;
		lvi.cchTextMax = nLen;
		lvi.pszText = str.GetBufferSetLength(nLen);
		nRes = (int)::SendMessage(hWnd,
			LVM_GETITEMTEXT, (WPARAM)nItem,
			(LPARAM)&lvi);
	} while (nRes == nLen - 1);
	str.ReleaseBuffer();
	return str;
}

GeneralRe: Save the content from List Control in text file vc++ Pin
David Crow22-Mar-17 5:26
David Crow22-Mar-17 5:26 
GeneralRe: Save the content from List Control in text file vc++ Pin
lolici22-Mar-17 5:35
lolici22-Mar-17 5:35 
GeneralRe: Save the content from List Control in text file vc++ Pin
David Crow22-Mar-17 5:37
David Crow22-Mar-17 5:37 
GeneralRe: Save the content from List Control in text file vc++ Pin
Victor Nijegorodov22-Mar-17 9:58
Victor Nijegorodov22-Mar-17 9:58 
GeneralRe: Save the content from List Control in text file vc++ Pin
lolici23-Mar-17 2:36
lolici23-Mar-17 2:36 
GeneralRe: Save the content from List Control in text file vc++ Pin
Victor Nijegorodov23-Mar-17 7:20
Victor Nijegorodov23-Mar-17 7:20 
GeneralRe: Save the content from List Control in text file vc++ Pin
lolici23-Mar-17 8:14
lolici23-Mar-17 8:14 
GeneralRe: Save the content from List Control in text file vc++ Pin
Victor Nijegorodov23-Mar-17 12:29
Victor Nijegorodov23-Mar-17 12:29 

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.