Erreur code C2027

aabhanane Messages postés 34 Date d'inscription jeudi 31 mars 2005 Statut Membre Dernière intervention 28 juillet 2005 - 4 juil. 2005 à 09:24
vecchio56 Messages postés 6535 Date d'inscription lundi 16 décembre 2002 Statut Membre Dernière intervention 22 août 2010 - 4 juil. 2005 à 20:20
Bonjour à tous,

j'ai trouvé un code sur le net pour faire une liste box de catégorie: http://www.codeproject.com/combobox/catlistbox.asp

j'ai un petit problème avec ce code:

struct CatListBoxItemInfo

{

CString sItem;

int iState;

DWORD dwValue;

};

typedef list<CatListBoxItemInfo> CatListBoxStlList;

typedef CatListBoxStlList::iterator CatListBoxStlListIter;

Quand je compile mon programme, j'ai l'erreur suivante: "error C2027:
use of undefined type '_A'" dans la ligne "typedef
CatListBoxStlList::iterator
CatListBoxStlListIter;" alors que le type CatListBoxStlList est définie
en haut.

Quelqu'un pourrait me dire pourquoi j'ai cette erreur?

Je travilles avec VC++.

Merci à tous.

1 réponse

vecchio56 Messages postés 6535 Date d'inscription lundi 16 décembre 2002 Statut Membre Dernière intervention 22 août 2010 14
4 juil. 2005 à 20:20
définis ta structure comme ca:



typedef struct _CatListBoxItemInfo

{

CString sItem;

int iState;

DWORD dwValue;

} CatListBoxItemInfo;



ou bien avec ta définition, tu dois écrire struct CatListBoxStlList au lieu de CatListBoxStlList tout court
0
Rejoignez-nous