Click here to Skip to main content
15,912,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRE: ATL and backgroud image Pin
Alex Gorev9-Dec-99 3:50
Alex Gorev9-Dec-99 3:50 
GeneralATL Exe Server Problem Pin
Member 103121488-Dec-99 8:36
Member 103121488-Dec-99 8:36 
GeneralRE: ATL Exe Server Problem Pin
Alex Gorev8-Dec-99 9:06
Alex Gorev8-Dec-99 9:06 
Generalchars above 127 not geting printed Pin
dharam8-Dec-99 0:01
dharam8-Dec-99 0:01 
GeneralRE: chars above 127 not geting printed Pin
Gary Menzel8-Dec-99 12:34
Gary Menzel8-Dec-99 12:34 
GeneralRE: RE: chars above 127 not geting printed Pin
dharam9-Dec-99 1:28
dharam9-Dec-99 1:28 
GeneralCList with user defined type is not working Pin
Benedikt Eckhard7-Dec-99 7:04
sussBenedikt Eckhard7-Dec-99 7:04 
GeneralRE: CList with user defined type is not working Pin
Member 103121488-Dec-99 8:56
Member 103121488-Dec-99 8:56 
The CList is a template. You need to define what is being stored in its definition. such as.

typedef struct TABELLE
{
CString strSQL;
CString intTID;
int intVokAnzahl;
CList<int,int> clistGeprueft;
};

After this the following works fine.

TABELLE NewTab;
NewTab.clistGeprueft.AddTail(20);
NewTab.clistGeprueft.AddTail(21);
NewTab.clistGeprueft.AddTail(24);

int myval;
myval = NewTab.clistGeprueft.GetHead();
POSITION pos = NewTab.clistGeprueft.GetHeadPosition();
myval = NewTab.clistGeprueft.GetNext(pos);
myval = NewTab.clistGeprueft.GetNext(pos);
myval = NewTab.clistGeprueft.GetNext(pos);
myval = NewTab.clistGeprueft.GetNext(pos);

NOTE the last line here fails because the list had 3 elements and I did not test for a NULL position.

==================
The original message was:

within my class i created a struct and a CList template containing the struct. but i something goes wrong when i try to add a struct variable to the CList object. Whats wrong?


#include "StdAfx.h"
#include "Afxtempl.h"

//HoleVok.h


class CHoleVok
{
private:

typedef struct TABELLE
{
CString strSQL;
CString intTID;
int intVokAnzahl;
CList<int,int> clistGeprueft;
};

CArray <tabelle,tabelle&> arrTabellen;

CDatabase *db;

public:
bool fnConnect(CDaoDatabase &db);

};
___________________________________________
#include "stdafx.h"
#include "HoleVok.h"

//HoleVok.cpp

bool CHoleVok::fnConnect(CDaoDatabase &db)
{
TABELLE tabTest1;
tabTest1.clistGeprueft.AddTail(20);
tabTest1.clistGeprueft.AddTail(21);
tabTest1.intTID = 4;
tabTest1.intVokAnzahl = 200;
tabTest1.strSQL = "Das Wetter ist schoen";

arrTabellen.Add(tabTest1);


return true;
}

GeneralRE: RE: CList with user defined type is not working Pin
Member 103121488-Dec-99 23:36
Member 103121488-Dec-99 23:36 
GeneralRE: RE: RE: CList with user defined type is not working Pin
Benedikt Eckhard9-Dec-99 8:28
sussBenedikt Eckhard9-Dec-99 8:28 
GeneralDynamic CEdit Control Pin
Amit Engineer6-Dec-99 23:43
Amit Engineer6-Dec-99 23:43 
Generalmirror image of a page (problem) Pin
Anonymous6-Dec-99 20:58
suss Anonymous6-Dec-99 20:58 
Generalarray[-1] Pin
Zerg6-Dec-99 18:36
Zerg6-Dec-99 18:36 
GeneralRE: array[-1] Pin
Mike Dunn6-Dec-99 20:52
Mike Dunn6-Dec-99 20:52 
GeneralRE: array[-1] Pin
Jesse Ezell14-Dec-99 14:51
Jesse Ezell14-Dec-99 14:51 
QuestionDisk space lists: any examples? Pin
Dean Edmonds5-Dec-99 13:58
sussDean Edmonds5-Dec-99 13:58 
GeneralDevStudio: AddToolSettings not recognized Pin
Dean Edmonds5-Dec-99 13:38
sussDean Edmonds5-Dec-99 13:38 
QuestionCVS addin? Pin
George5-Dec-99 5:18
George5-Dec-99 5:18 
AnswerRE: CVS addin? Pin
Member 48657-Dec-99 10:55
Member 48657-Dec-99 10:55 
AnswerRE: CVS addin? Pin
Neville Franks8-Dec-99 9:51
Neville Franks8-Dec-99 9:51 
QuestionHow to change mouse cursor when move mouse pass the button? Pin
Comp-devz4-Dec-99 21:02
sussComp-devz4-Dec-99 21:02 
AnswerRE: How to change mouse cursor when move mouse pass the button? Pin
Jeremy Davis6-Dec-99 2:43
Jeremy Davis6-Dec-99 2:43 
AnswerRE: How to change mouse cursor when move mouse pass the button? Pin
Gary Menzel8-Dec-99 12:42
Gary Menzel8-Dec-99 12:42 
GeneralQuestion about dll Pin
Roy Xu3-Dec-99 17:13
Roy Xu3-Dec-99 17:13 
GeneralRE: Question about dll Pin
Alex Gorev6-Dec-99 7:10
Alex Gorev6-Dec-99 7:10 

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.