Click here to Skip to main content
15,894,362 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Detecting when an internet connection is active Pin
valikac7-Jan-03 9:20
valikac7-Jan-03 9:20 
GeneralRe: Detecting when an internet connection is active Pin
Todd Smith7-Jan-03 9:58
Todd Smith7-Jan-03 9:58 
GeneralCStatic scroll bar Pin
Dean Goodman7-Jan-03 7:37
Dean Goodman7-Jan-03 7:37 
GeneralRe: CStatic scroll bar Pin
PJ Arends7-Jan-03 11:48
professionalPJ Arends7-Jan-03 11:48 
GeneralListView InsertMark does not display Pin
Hiusing7-Jan-03 6:59
Hiusing7-Jan-03 6:59 
GeneralContext Help on a button in MFC CFormView Pin
DionChen7-Jan-03 5:55
DionChen7-Jan-03 5:55 
GeneralRe: Context Help on a button in MFC CFormView Pin
PJ Arends7-Jan-03 11:54
professionalPJ Arends7-Jan-03 11:54 
GeneralCListCtrl::GetItemData() Problem Pin
lpvoid7-Jan-03 5:39
lpvoid7-Jan-03 5:39 
I have a class that is a data consumer with an identification number, when an object is instantiated a temporary ID is assigned to the object until it can dynamically aquire it's "real" number.

I have a CListCtrl that displays a list of these objects with their IDs as the label. As an object is created it needs to be displayed in this control so obviously the temporary ID is used until the real one comes along. The control is updated every second and when the new ID gets updated in the obj I need to be able to update the control to reflect this change without adding an additional line and leaving the old one hanging around. What I've done is, because the ojects are stored in a CMap, I store the key for each object in the ItemData of the list item. But when I go to pull the item data out, I don't always get the data I put in there. My code is below:

POSITION Pos = m_IndexToObjectMap.GetStartPosition();
long key = 0;
CString name = _T(" ");
CString id = _T(" ");
CDataClass Obj;
while(Pos != NULL){
bool bItemInList = false;
m_IndexToObjectMap.GetNextAssoc(Pos, key, Obj);
if(GetId(key) < 1)
continue;
id.Format("%.0f", GetId(key));
name = GetName(key);
for(int i = 0; i < m_List.GetItemCount(); i++){
if(key == (long)m_List.GetItemData(i)){
m_List.SetItemText(i, 0, id);
m_List.SetItemText(i, 1, name);
bItemInList = true;
break;
}
}
if(!bItemInList){
m_List.InsertItem(0, id);
m_List.SetItemText(0, 1, name);
m_List.SetItemData(0, (DWORD) key);
}
}

Any assistance is greatly appreciated,
John
Generaldisplay a jpg Pin
Didaa7-Jan-03 3:35
Didaa7-Jan-03 3:35 
GeneralRe: display a jpg Pin
Gary Kirkham7-Jan-03 5:01
Gary Kirkham7-Jan-03 5:01 
GeneralRe: display a jpg Pin
Davide Pizzolato7-Jan-03 11:05
Davide Pizzolato7-Jan-03 11:05 
GeneralRe: display a jpg Pin
Jason Henderson7-Jan-03 11:29
Jason Henderson7-Jan-03 11:29 
GeneralMy paranoia Pin
georgiek507-Jan-03 2:47
georgiek507-Jan-03 2:47 
GeneralRe: My paranoia Pin
Maximilien7-Jan-03 3:17
Maximilien7-Jan-03 3:17 
GeneralRe: My paranoia Pin
Alvaro Mendez7-Jan-03 5:19
Alvaro Mendez7-Jan-03 5:19 
GeneralRe: My paranoia Pin
georgiek507-Jan-03 6:26
georgiek507-Jan-03 6:26 
GeneralPropertySheet Pin
mzakarni7-Jan-03 0:42
mzakarni7-Jan-03 0:42 
GeneralRe: PropertySheet Pin
Abbas_Riazi7-Jan-03 0:49
professionalAbbas_Riazi7-Jan-03 0:49 
GeneralRe: PropertySheet Pin
mzakarni7-Jan-03 2:05
mzakarni7-Jan-03 2:05 
QuestionWhy disables my program Drag&Drop after running some time ? Pin
pma7-Jan-03 0:00
pma7-Jan-03 0:00 
Answerhadle limits? Pin
AlexO7-Jan-03 2:45
AlexO7-Jan-03 2:45 
GeneralRe: hadle limits? Pin
pma7-Jan-03 3:37
pma7-Jan-03 3:37 
QuestionHow to insert a CView in another CView? Pin
Ivano6-Jan-03 23:30
Ivano6-Jan-03 23:30 
AnswerRe: How to insert a CView in another CView? Pin
AlexO7-Jan-03 2:47
AlexO7-Jan-03 2:47 
GeneralRe: How to insert a CView in another CView? Pin
Ivano7-Jan-03 2:54
Ivano7-Jan-03 2:54 

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.