Click here to Skip to main content
15,922,325 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalwin32 api - toolbar Pin
Anonymous8-Apr-03 21:48
Anonymous8-Apr-03 21:48 
GeneralMapping client controls messages in a CFromView Pin
Anonymous8-Apr-03 21:17
Anonymous8-Apr-03 21:17 
GeneralAdding MFC to a console application Pin
R.E.L8-Apr-03 20:42
R.E.L8-Apr-03 20:42 
GeneralRe: Adding MFC to a console application Pin
harinath8-Apr-03 22:34
professionalharinath8-Apr-03 22:34 
GeneralThread's Problem Pin
fyf_tmp8-Apr-03 20:41
fyf_tmp8-Apr-03 20:41 
QuestionMicrosoft Web Browser Object into DialogBox, without MFC? Pin
Adrian Bacaianu8-Apr-03 20:16
Adrian Bacaianu8-Apr-03 20:16 
GeneralProblem in changing the progress abr color Pin
summo8-Apr-03 20:06
summo8-Apr-03 20:06 
QuestionCList inside CMap not working? Pin
Kevein8-Apr-03 16:51
Kevein8-Apr-03 16:51 
Hello all,
In MFC programming, I get the following data strucutre, and I find the CList seems not working as I want.
The data structure looks like:

//(in the .h file)
typedef CList<cstring,cstring> obj_map_list_type;
CMapStringToOb obj_map;

where each element in the obj_map is a clist type as obj_map_list_type.
I use the obj_map like:

//(in my .cpp file)
obj_map_list_type * obj_map_list;
obj_map_list = new obj_map_list_type;
obj_map_list->AddTail("AAAAAAA");
obj_map_list->AddTail("BBBBbB");
obj_map.SetAt("ABC", obj_map_list);
......

Surely, it is clear that my goal is to construct a CMapStringToOb map, in which each element is a CList containing a list of string.
However, when I try to retrieve the saved data, it is not working. The following code follows the previous code:

//(in my .cpp file)
POSITION pos, kk2;
obj_map_list_type obj;
CString key;
int int_jj;
pos=obj_map.GetStartPosition();
while (pos!=NULL)
{
obj_map.GetNextAssoc(pos, key, (CObject*&) obj);
kk2=obj.GetHeadPosition();
// from debug, I see the kk2 returned is NULL !! strange?
int_jj=obj.GetCount();
// it is strange that int_jj's value is zero!
while (kk2!=NULL) // so this while is never executed.
{
key=obj.GetNext(kk2);
};
};

About the data type convertation in the GetNextAssoc, if I write it like:
obj_map.GetNextAssoc(pos, key, obj);
The compiler will say:
GetNextAssoc' : cannot convert parameter 3 from 'class CList<class cstring,class="" cstring="">' to 'class CObject *&

Anyone has any idea why my CList data can not be retrieved?

Thanks a lot and have a nice day. Smile | :)
AnswerRe: CList inside CMap not working? Pin
Dave Bryant8-Apr-03 16:54
Dave Bryant8-Apr-03 16:54 
GeneralRe: CList inside CMap not working? Pin
Kevein8-Apr-03 17:07
Kevein8-Apr-03 17:07 
GeneralRe: CList inside CMap not working? Pin
Dave Bryant8-Apr-03 17:14
Dave Bryant8-Apr-03 17:14 
GeneralRe: CList inside CMap not working? Pin
Kevein8-Apr-03 17:45
Kevein8-Apr-03 17:45 
AnswerRe: CList inside CMap not working? Pin
Shog98-Apr-03 17:17
sitebuilderShog98-Apr-03 17:17 
GeneralRe: CList inside CMap not working? Pin
Kevein8-Apr-03 17:46
Kevein8-Apr-03 17:46 
QuestionHow to add closed caption to Video Pin
Prudhvi Raju8-Apr-03 16:24
Prudhvi Raju8-Apr-03 16:24 
GeneralQ: winmm.lib and WAVE Output Pin
europajacek8-Apr-03 15:28
europajacek8-Apr-03 15:28 
GeneralPointer to DWORD Pin
DuFF8-Apr-03 14:36
DuFF8-Apr-03 14:36 
GeneralRe: Pointer to DWORD Pin
Taka Muraoka8-Apr-03 14:59
Taka Muraoka8-Apr-03 14:59 
GeneralRe: Pointer to DWORD Pin
DuFF8-Apr-03 15:21
DuFF8-Apr-03 15:21 
GeneralRe: Pointer to DWORD Pin
Taka Muraoka8-Apr-03 15:27
Taka Muraoka8-Apr-03 15:27 
GeneralAutomation compliant COM Vs ActiveX Pin
devvvy8-Apr-03 12:59
devvvy8-Apr-03 12:59 
GeneralRe: Automation compliant COM Vs ActiveX Pin
J. Dunlap8-Apr-03 14:02
J. Dunlap8-Apr-03 14:02 
GeneralRe: Automation compliant COM Vs ActiveX Pin
Anonymous8-Apr-03 17:57
Anonymous8-Apr-03 17:57 
GeneralRe: Automation compliant COM Vs ActiveX Pin
J. Dunlap8-Apr-03 18:01
J. Dunlap8-Apr-03 18:01 
GeneralApplication aborts Windows shutdown Pin
RaiderCE8-Apr-03 12:35
RaiderCE8-Apr-03 12:35 

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.