Click here to Skip to main content
15,921,840 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Use text that a user input in an Edit Box in MFC Pin
ThatsAlok18-Feb-05 20:31
ThatsAlok18-Feb-05 20:31 
GeneralRe: Use text that a user input in an Edit Box in MFC Pin
Blake Miller22-Feb-05 6:56
Blake Miller22-Feb-05 6:56 
GeneralRe: Use text that a user input in an Edit Box in MFC Pin
22491718-Feb-05 19:23
22491718-Feb-05 19:23 
GeneralRe: Use text that a user input in an Edit Box in MFC Pin
reenacutie18-Feb-05 19:39
reenacutie18-Feb-05 19:39 
GeneralRe: Use text that a user input in an Edit Box in MFC Pin
22491718-Feb-05 20:14
22491718-Feb-05 20:14 
GeneralRe: Use text that a user input in an Edit Box in MFC Pin
Maximilien18-Feb-05 20:48
Maximilien18-Feb-05 20:48 
GeneralRe: Use text that a user input in an Edit Box in MFC Pin
jhwurmbach19-Feb-05 3:16
jhwurmbach19-Feb-05 3:16 
QuestionWhy doesn't this work? Pin
Zero_divide_118-Feb-05 18:36
Zero_divide_118-Feb-05 18:36 
I have the following code adding to a CListCtl on a dialog box named m_cList, but for some reason the first element I add doesn't show up:

<br />
LRESULT CRTFParseTest1Dlg::OnCreateListGroup(WPARAM wParam, LPARAM lParam)<br />
{<br />
	CStringArray sa,<br />
		sa1;<br />
	CString sFormat;<br />
<br />
	for(int a(0); a < 3; a++) {<br />
		sFormat.Format("Column %d", a);<br />
		sa.Add(sFormat);<br />
	}<br />
	InsertColumns(sa);<br />
	sa.RemoveAll();<br />
<br />
	sa.Add("Item");<br />
	for(int b(0); b < 5; b++) {<br />
		sFormat.Format("Group %d", b);<br />
		AddListGroup(b, sFormat);<br />
<br />
		for(int b_0(0); b_0 < 2; b_0++) {<br />
			sa[0].Format("%d:%d", b,b_0);<br />
			AddItemToGroup(b_0, sa, b);<br />
		}<br />
	}<br />
<br />
	return 0;<br />
}<br />
<br />
<br />
LRESULT CRTFParseTest1Dlg::AddListGroup(int id, CString sTitle)<br />
{<br />
	USES_CONVERSION;<br />
<br />
	if(!m_cList.IsGroupViewEnabled()) {<br />
		if(m_cList.EnableGroupView(TRUE) == -1 || !m_cList.IsGroupViewEnabled()) {<br />
			TRACE("==>CParseTest1Dlg::AddListGroup { Could not enable list grouping }\n");<br />
			return -1;<br />
		}<br />
	}<br />
<br />
	LVGROUP lvg;<br />
	ZeroMemory(&lvg, sizeof(lvg));<br />
<br />
	lvg.cbSize = sizeof(LVGROUP);<br />
	lvg.mask = LVGF_GROUPID | LVGF_HEADER | LVGF_STATE;<br />
	lvg.pszHeader = A2W(sTitle);<br />
	lvg.cchHeader = sTitle.GetLength();<br />
	lvg.iGroupId = id;<br />
	lvg.stateMask = LVGS_NORMAL;<br />
	lvg.state = LVGS_NORMAL;<br />
<br />
	return m_cList.InsertGroup(-1, &lvg);<br />
}<br />
<br />
LRESULT CRTFParseTest1Dlg::AddItemToGroup(int id, CStringArray &sColumnText, int iGroupId/* = -1*/)<br />
{<br />
	int iRes = m_cList.InsertItem(id, sColumnText[0]);<br />
	<br />
	if(iRes >= 0) {<br />
		iRes = TRUE;<br />
		for(int i(1); i < sColumnText.GetSize() && iRes != FALSE; i++) {<br />
			iRes = m_cList.SetItemText(id, i, sColumnText[i]);<br />
		}<br />
<br />
		if(iRes != FALSE && iGroupId != -1) {<br />
			LVITEM lvi;<br />
			lvi.mask = LVIF_GROUPID;<br />
			lvi.iGroupId = iGroupId;<br />
			lvi.iItem = i;<br />
<br />
			iRes = m_cList.SetItem(&lvi);<br />
		}<br />
	}<br />
	return iRes;<br />
}<br />
<br />
bool CRTFParseTest1Dlg::InsertColumns(CStringArray &sColumnTitles)<br />
{<br />
	int iRes(0);<br />
	for(int i(0); i < sColumnTitles.GetSize() && iRes!=-1; i++) {<br />
		iRes = m_cList.InsertColumn(i, sColumnTitles[i], LVCFMT_LEFT, 100);<br />
	}<br />
	return (iRes != -1);<br />
}<br />

Any idea how to make it work?
AnswerRe: Why doesn't this work? Pin
22491718-Feb-05 20:10
22491718-Feb-05 20:10 
GeneralRe: Why doesn't this work? Pin
Zero_divide_119-Feb-05 9:48
Zero_divide_119-Feb-05 9:48 
Generalsystem() fails in service mode Pin
ace_maggot18-Feb-05 18:34
ace_maggot18-Feb-05 18:34 
GeneralRe: system() fails in service mode Pin
22491718-Feb-05 19:15
22491718-Feb-05 19:15 
Generalwininit.ini Pin
includeh1018-Feb-05 18:17
includeh1018-Feb-05 18:17 
GeneralRe: wininit.ini Pin
Michael Dunn18-Feb-05 19:17
sitebuilderMichael Dunn18-Feb-05 19:17 
GeneralRe: wininit.ini Pin
includeh1018-Feb-05 22:59
includeh1018-Feb-05 22:59 
Generaldelete a file Pin
includeh1018-Feb-05 17:47
includeh1018-Feb-05 17:47 
GeneralRe: delete a file Pin
22491718-Feb-05 17:55
22491718-Feb-05 17:55 
GeneralRe: delete a file Pin
ThatsAlok18-Feb-05 19:05
ThatsAlok18-Feb-05 19:05 
GeneralDetect Dlls dynamically and statically load it Pin
Member 174261018-Feb-05 16:56
Member 174261018-Feb-05 16:56 
GeneralRe: Detect Dlls dynamically and statically load it Pin
Andrew Walker18-Feb-05 17:22
Andrew Walker18-Feb-05 17:22 
Questionvector,list and dqueue ? Pin
xcavin18-Feb-05 16:35
xcavin18-Feb-05 16:35 
AnswerRe: vector,list and dqueue ? Pin
Andrew Walker18-Feb-05 17:26
Andrew Walker18-Feb-05 17:26 
GeneralStrFormatByteSize don't work...help Pin
baboguru18-Feb-05 16:07
baboguru18-Feb-05 16:07 
GeneralRe: StrFormatByteSize don't work...help Pin
Michael Dunn18-Feb-05 16:16
sitebuilderMichael Dunn18-Feb-05 16:16 
Generalthank you very much Pin
baboguru22-Feb-05 15:17
baboguru22-Feb-05 15:17 

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.