Help! cannot use CTypedPtrList
-
hi, guys i need to use a CTypedPtrList templet structure in my program. here is my code: (CFreqStandard is a class which i derived from CObject and it's basically used to store some data) class CSDIgDoc : public CDocument { protected: // create from serialization only CSDIgDoc(); DECLARE_DYNCREATE(CSDIgDoc) protected: //CTypedPtrList FreqList; //CString StandardName; CString StandardName; CTypedPtrList m_FreqList;///////////////////// // Attributes public: // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CSDIgDoc) public: virtual BOOL OnNewDocument(); virtual void Serialize(CArchive& ar); //}}AFX_VIRTUAL // Implementation public: virtual ~CSDIgDoc(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: // Generated message map functions protected: //{{AFX_MSG(CSDIgDoc) //}}AFX_MSG DECLARE_MESSAGE_MAP() }; but when i compile i always get an error in the line CTypedPtrList m_FreqList; it shows that "'CTypedPtrList' : missing storage-class or type specifiers" what is the problem in this case?:(( Thank you very much in advance
-
hi, guys i need to use a CTypedPtrList templet structure in my program. here is my code: (CFreqStandard is a class which i derived from CObject and it's basically used to store some data) class CSDIgDoc : public CDocument { protected: // create from serialization only CSDIgDoc(); DECLARE_DYNCREATE(CSDIgDoc) protected: //CTypedPtrList FreqList; //CString StandardName; CString StandardName; CTypedPtrList m_FreqList;///////////////////// // Attributes public: // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CSDIgDoc) public: virtual BOOL OnNewDocument(); virtual void Serialize(CArchive& ar); //}}AFX_VIRTUAL // Implementation public: virtual ~CSDIgDoc(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: // Generated message map functions protected: //{{AFX_MSG(CSDIgDoc) //}}AFX_MSG DECLARE_MESSAGE_MAP() }; but when i compile i always get an error in the line CTypedPtrList m_FreqList; it shows that "'CTypedPtrList' : missing storage-class or type specifiers" what is the problem in this case?:(( Thank you very much in advance
You never defined the types to use for the template, like this for example:
typedef CTypedPtrList m_FreqList;
Have a look to this article[^] of MSDN for a sample. HTH, K.
Mais donnez-moi aussi Le courage et la force et la foi Car vous êtes le seul à donner Ce que l'on ne peut obtenir que de soi.