Click here to Skip to main content
15,897,187 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: volume control Pin
David Crow12-Feb-04 5:50
David Crow12-Feb-04 5:50 
GeneralRe: how to read sectors from CD_ROM Pin
David Crow12-Feb-04 5:46
David Crow12-Feb-04 5:46 
GeneralIDispatch Interface for IE Pin
balifrank12-Feb-04 3:11
balifrank12-Feb-04 3:11 
GeneralRe: IDispatch Interface for IE Pin
Anonymous12-Feb-04 7:21
Anonymous12-Feb-04 7:21 
GeneralRe: IDispatch Interface for IE Pin
balifrank16-Feb-04 22:47
balifrank16-Feb-04 22:47 
GeneralControls Disappeat when I press "Enter" on a PropertyPage Pin
iffi99212-Feb-04 3:08
iffi99212-Feb-04 3:08 
GeneralRe: Controls Disappeat when I press "Enter" on a PropertyPage Pin
Maximilien12-Feb-04 3:14
Maximilien12-Feb-04 3:14 
QuestionMFC: Continuosly looping problem? Pin
Ashman11-Feb-04 22:19
Ashman11-Feb-04 22:19 
Hi, I have the following code:
CString itemcount2;<br />
		SetDlgItemText(IDC_BUGGER, _T(itemcount));<br />
		GetDlgItemText(IDC_BUGGER,itemcount2);<br />
		for (int i=1;i<itemcount;i++){<br />
			<br />
<br />
<br />
		CString sku;<br />
		CString model;<br />
		CString qty;<br />
		CString sell;<br />
	<br />
		<br />
		int nItemCount = atoi(itemcount2) - 1;<br />
		itemcount2.Format(_T("%d"),nItemCount);<br />
	<br />
		sku=ini.GetValue("Item"+itemcount2,"Sku");<br />
		model=ini.GetValue("Item"+itemcount2,"Model");<br />
		qty=ini.GetValue("Item"+itemcount2,"QTY");<br />
		sell=ini.GetValue("Item"+itemcount2,"Sell");<br />
	<br />
<br />
		const int IDX = m_sold.InsertItem(i, _T(""));<br />
		m_sold.SetItemText(IDX, 0,itemcount2);<br />
		m_sold.SetItemText(IDX, 1,sku);<br />
		m_sold.SetItemText(IDX, 2,model);<br />
		m_sold.SetItemText(IDX, 3,qty);<br />
		m_sold.SetItemText(IDX, 4,sell);


The idea is to get the String for itemcount out of an ini file. Then to loop the function to the value of itemcount. Lets say for example that itemcount = 4, in the list control it will add all the items etc, but it will continue adding rows until -43.

I have worked out that if I didnt have the
int nItemCount = atoi(itemcount2) - 1;<br />
itemcount2.Format(_T("%d"),nItemCount);
in it, that it wouldn't create rows to -43, however it wouldn't show all the data I needed to add to the list control.

Is there anyway to stop it from going below 0?

I dont know if anyone can understand this, I barely do. itemcount is read from an ini file using CIniEx.

Thanks in advance
Ashman
AnswerRe: MFC: Continuosly looping problem? Pin
David Crow12-Feb-04 2:56
David Crow12-Feb-04 2:56 
GeneralCapturing mouse coordinates Pin
techysavvy11-Feb-04 21:54
techysavvy11-Feb-04 21:54 
GeneralRe: Capturing mouse coordinates Pin
jerry0davis11-Feb-04 22:07
jerry0davis11-Feb-04 22:07 
GeneralRe: Capturing mouse coordinates Pin
Iain Clarke, Warrior Programmer11-Feb-04 22:25
Iain Clarke, Warrior Programmer11-Feb-04 22:25 
GeneralRe: Capturing mouse coordinates Pin
Vitali Halershtein11-Feb-04 22:29
Vitali Halershtein11-Feb-04 22:29 
GeneralWho are intrested in Nokia Symbian Series60 mobile phone development using VC++ Pin
Atif Mushtaq11-Feb-04 20:51
Atif Mushtaq11-Feb-04 20:51 
GeneralRe: Who are intrested in Nokia Symbian Series60 mobile phone development using VC++ Pin
Antti Keskinen11-Feb-04 20:55
Antti Keskinen11-Feb-04 20:55 
GeneralRe: Who are intrested in Nokia Symbian Series60 mobile phone development using VC++ Pin
lynhoo11-Feb-04 22:02
lynhoo11-Feb-04 22:02 
GeneralRe: Who are intrested in Nokia Symbian Series60 mobile phone development using VC++ Pin
Atif Mushtaq12-Feb-04 0:45
Atif Mushtaq12-Feb-04 0:45 
GeneralRe: Who are intrested in Nokia Symbian Series60 mobile phone development using VC++ Pin
Atif Mushtaq12-Feb-04 0:42
Atif Mushtaq12-Feb-04 0:42 
GeneralRe: Who are intrested in Nokia Symbian Series60 mobile phone development using VC++ Pin
Antti Keskinen12-Feb-04 9:06
Antti Keskinen12-Feb-04 9:06 
GeneralRe: Who are intrested in Nokia Symbian Series60 mobile phone development using VC++ Pin
Atif Mushtaq12-Feb-04 18:22
Atif Mushtaq12-Feb-04 18:22 
GeneralBitmap Pin
Best Friend11-Feb-04 20:07
Best Friend11-Feb-04 20:07 
GeneralRe: Bitmap Pin
Antti Keskinen11-Feb-04 20:45
Antti Keskinen11-Feb-04 20:45 
GeneralRe: Bitmap Pin
Best Friend12-Feb-04 19:37
Best Friend12-Feb-04 19:37 
GeneralHandle to scrollbar in CListCtrl Pin
JussiL11-Feb-04 19:49
JussiL11-Feb-04 19:49 
GeneralRe: Handle to scrollbar in CListCtrl Pin
Antti Keskinen11-Feb-04 20:37
Antti Keskinen11-Feb-04 20:37 

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.