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

C / C++ / MFC

 
QuestionHello! I urgently need the program code. Help me with!! Pin
vudvpro25-Oct-09 8:48
vudvpro25-Oct-09 8:48 
AnswerRe: Hello! I urgently need the program code. Help me with!! Pin
CPallini25-Oct-09 9:07
mveCPallini25-Oct-09 9:07 
AnswerRe: Hello! I urgently need the program code. Help me with!! Pin
Rajesh R Subramanian25-Oct-09 9:32
professionalRajesh R Subramanian25-Oct-09 9:32 
RantRe: Hello! I urgently need the program code. Help me with!! Pin
Iain Clarke, Warrior Programmer25-Oct-09 10:01
Iain Clarke, Warrior Programmer25-Oct-09 10:01 
GeneralRe: Hello! I urgently need the program code. Help me with!! Pin
vudvpro26-Oct-09 9:57
vudvpro26-Oct-09 9:57 
AnswerRe: Hello! I urgently need the program code. Help me with!! Pin
Richard MacCutchan25-Oct-09 13:20
mveRichard MacCutchan25-Oct-09 13:20 
JokeRe: Hello! I urgently need the program code. Help me with!! Pin
David Crow26-Oct-09 3:46
David Crow26-Oct-09 3:46 
Questionint returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 8:29
Manmohan2925-Oct-09 8: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 8:46
mveRichard MacCutchan25-Oct-09 8:46 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 8:54
Manmohan2925-Oct-09 8:54 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Iain Clarke, Warrior Programmer25-Oct-09 9:42
Iain Clarke, Warrior Programmer25-Oct-09 9:42 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 9:51
Manmohan2925-Oct-09 9:51 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Richard MacCutchan25-Oct-09 12:27
mveRichard MacCutchan25-Oct-09 12:27 
JokeRe: int returned as binary no. from CListCtrl::InsertItem Pin
CPallini25-Oct-09 9:17
mveCPallini25-Oct-09 9:17 
AnswerRe: int returned as binary no. from CListCtrl::InsertItem Pin
«_Superman_»25-Oct-09 8:55
professional«_Superman_»25-Oct-09 8:55 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 9:07
Manmohan2925-Oct-09 9:07 
AnswerRe: int returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 9:46
Manmohan2925-Oct-09 9:46 
QuestionIPC Programme Need Help ! Pin
appollosputnik25-Oct-09 8:04
appollosputnik25-Oct-09 8:04 
AnswerRe: IPC Programme Need Help ! Pin
CPallini25-Oct-09 9:11
mveCPallini25-Oct-09 9:11 
QuestionRegarding Colors for the Entire Colums in a CListCntrl Item. Pin
janaswamy uday25-Oct-09 6:25
janaswamy uday25-Oct-09 6:25 
AnswerRe: Regarding Colors for the Entire Colums in a CListCntrl Item. Pin
Rajesh R Subramanian25-Oct-09 6:42
professionalRajesh R Subramanian25-Oct-09 6:42 
QuestionUsing splitter in the CDockablePane Pin
AshishMahajan25-Oct-09 6:13
AshishMahajan25-Oct-09 6:13 
QuestionMemory Leak Part II Pin
BarryPearlman25-Oct-09 4:45
BarryPearlman25-Oct-09 4:45 
AnswerRe: Memory Leak Part II Pin
Rajesh R Subramanian25-Oct-09 6:14
professionalRajesh R Subramanian25-Oct-09 6:14 
GeneralRe: Memory Leak Part II Pin
BarryPearlman25-Oct-09 14:09
BarryPearlman25-Oct-09 14: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.