Strange kind of class
-
HI Strange kind of class Some times I see this class like below : LINE 1 : class CImage; LINE 2 : class CTestpicDlg : public CDialog LINE 3 : { LINE 4 : // Construction LINE 5 : public: LINE 6 : void draw(); LINE 7 : CImage *image; LINE 8 : CTestpicDlg(CWnd* pParent = NULL); // standard constructor LINE 9 : } So my question is about two thing's : 1- (CImage)class ,it hasn't any braces and !!! 2- The (CImage)class defined in cimage.lib which I append it in my project so why I must write LINE 1, if I omit this line I get alot of errors like : error C2143: syntax error : missing ';' before '*' error C2501: 'CImage' : missing storage-class or type specifiers Thank you ... AHMAD ALWASHALI
-
HI Strange kind of class Some times I see this class like below : LINE 1 : class CImage; LINE 2 : class CTestpicDlg : public CDialog LINE 3 : { LINE 4 : // Construction LINE 5 : public: LINE 6 : void draw(); LINE 7 : CImage *image; LINE 8 : CTestpicDlg(CWnd* pParent = NULL); // standard constructor LINE 9 : } So my question is about two thing's : 1- (CImage)class ,it hasn't any braces and !!! 2- The (CImage)class defined in cimage.lib which I append it in my project so why I must write LINE 1, if I omit this line I get alot of errors like : error C2143: syntax error : missing ';' before '*' error C2501: 'CImage' : missing storage-class or type specifiers Thank you ... AHMAD ALWASHALI
LINE 1: Class CImage; is a forward reference to another class that lets the CTestPicDlg class know what to do with the LINE 7: CImage *image ptr type ... excluding LINE 1: gives compile errors cos the compiler then doesnt know what CImage is :) --- "every year we invent better idiot proof systems and every year they invent better idiots"
-
LINE 1: Class CImage; is a forward reference to another class that lets the CTestPicDlg class know what to do with the LINE 7: CImage *image ptr type ... excluding LINE 1: gives compile errors cos the compiler then doesnt know what CImage is :) --- "every year we invent better idiot proof systems and every year they invent better idiots"
-
Thank you lauren but (CImage)class defined in cimage.lib which I append it in my project can you tell me please AHMAD ALWASHALI