Compilation error when declare class
hai,
I am a new to embedded visual C++. I have installed embedded visual C++ 4.0 and WinCE standard sdk 420 to do testing.
I have created a class call CPerson and add serialize function into into this class. Ihave no problem on creating and compiling this class.
But when I try to use this class as below in Document Class
SerializeDoc.h
-------------------
private:
CPerson* AddNewRecord();
SerializeDoc.cpp
-------------------
CPerson* CSerializeDoc::AddNewRecord()
{
CPerson *pPerson = new CPerson();
return pPerson;
}
when I build this after inserting this code, it give me these errors:
C:\Documents and Settings\user1\My Documents\Serialize\SerializeDoc.h(51) : error C2143: syntax error : missing ';' before '*'
C:\Documents and Settings\user1\My Documents\Serialize\SerializeDoc.h(51) : error C2501: 'CPerson' : missing storage-class or type specifiers
C:\Documents and Settings\user1\My Documents\Serialize\SerializeDoc.h(51) : error C2501: 'AddNewRecord' : missing storage-class or type specifiers
This thing already stuck me few days, can some one pls help.
Thanks in advance.
Regards.
|