Click here to Skip to main content
15,845,598 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHello! I urgently need the program code. Help me with!! Pin
vudvpro25-Oct-09 9:48
vudvpro25-Oct-09 9:48 
AnswerRe: Hello! I urgently need the program code. Help me with!! Pin
CPallini25-Oct-09 10:07
mveCPallini25-Oct-09 10:07 
AnswerRe: Hello! I urgently need the program code. Help me with!! Pin
Rajesh R Subramanian25-Oct-09 10:32
professionalRajesh R Subramanian25-Oct-09 10:32 
RantRe: Hello! I urgently need the program code. Help me with!! Pin
Iain Clarke, Warrior Programmer25-Oct-09 11:01
Iain Clarke, Warrior Programmer25-Oct-09 11:01 
GeneralRe: Hello! I urgently need the program code. Help me with!! Pin
vudvpro26-Oct-09 10:57
vudvpro26-Oct-09 10:57 
AnswerRe: Hello! I urgently need the program code. Help me with!! Pin
Richard MacCutchan25-Oct-09 14:20
mveRichard MacCutchan25-Oct-09 14:20 
JokeRe: Hello! I urgently need the program code. Help me with!! Pin
David Crow26-Oct-09 4:46
David Crow26-Oct-09 4:46 
Questionint returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 9:29
Manmohan2925-Oct-09 9:29 
In my MFC program the int 10 (ten) is treated as binary 10 (one & zero) i.e. == 2.
So when I insert any item at 10th position then it is inserted at 2nd position.
Similarly for 100th item it is inserted at 4th position.
My program is a Dialog Based Application.
m_ctlDeviceList is control variable for ListCtrl and it is set in Report View.

void CIPMDlg::OnBnClickedBrefreshdevices()
{
	// TODO: Add your control notification handler code here
	int field0 = 0, field1 = 0, field2 = 0, field3 = 0;
	int c=0, nIndex=0;
	CString ips = _T("");

	for (field0 = 192; field0 <= 192; field0++)
	{
		for (field1 = 168; field1 <= 168; field1++)
		{
			for (field2 = 0; field2 <= 255; field2++)
			{
				for (field3 = 0; field3 <= 255; field3++)
				{
					ips.Format(_T("192.168.%u.%u"), field2, field3);

					nIndex = m_ctlDeviceList.InsertItem(c, ips);
					m_ctlDeviceList.SetItemText(nIndex, 1, _T("Testing"));

					c++;
				}
			}
		}

	}
}


Why is this happening?

Future Lies in Present.
Manmohan Bishnoi

AnswerRe: int returned as binary no. from CListCtrl::InsertItem Pin
Richard MacCutchan25-Oct-09 9:46
mveRichard MacCutchan25-Oct-09 9:46 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 9:54
Manmohan2925-Oct-09 9:54 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Iain Clarke, Warrior Programmer25-Oct-09 10:42
Iain Clarke, Warrior Programmer25-Oct-09 10:42 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 10:51
Manmohan2925-Oct-09 10:51 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Richard MacCutchan25-Oct-09 13:27
mveRichard MacCutchan25-Oct-09 13:27 
JokeRe: int returned as binary no. from CListCtrl::InsertItem Pin
CPallini25-Oct-09 10:17
mveCPallini25-Oct-09 10:17 
AnswerRe: int returned as binary no. from CListCtrl::InsertItem Pin
«_Superman_»25-Oct-09 9:55
professional«_Superman_»25-Oct-09 9:55 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 10:07
Manmohan2925-Oct-09 10:07 
AnswerRe: int returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 10:46
Manmohan2925-Oct-09 10:46 
QuestionIPC Programme Need Help ! Pin
appollosputnik25-Oct-09 9:04
appollosputnik25-Oct-09 9:04 
AnswerRe: IPC Programme Need Help ! Pin
CPallini25-Oct-09 10:11
mveCPallini25-Oct-09 10:11 
QuestionRegarding Colors for the Entire Colums in a CListCntrl Item. Pin
janaswamy uday25-Oct-09 7:25
janaswamy uday25-Oct-09 7:25 
AnswerRe: Regarding Colors for the Entire Colums in a CListCntrl Item. Pin
Rajesh R Subramanian25-Oct-09 7:42
professionalRajesh R Subramanian25-Oct-09 7:42 
QuestionUsing splitter in the CDockablePane Pin
AshishMahajan25-Oct-09 7:13
AshishMahajan25-Oct-09 7:13 
QuestionMemory Leak Part II Pin
BarryPearlman25-Oct-09 5:45
BarryPearlman25-Oct-09 5:45 
AnswerRe: Memory Leak Part II Pin
Rajesh R Subramanian25-Oct-09 7:14
professionalRajesh R Subramanian25-Oct-09 7:14 
GeneralRe: Memory Leak Part II Pin
BarryPearlman25-Oct-09 15:09
BarryPearlman25-Oct-09 15:09 

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.