Link to home
Start Free TrialLog in
Avatar of k1024
k1024

asked on

syntax error : 'constant'

netiod?
I followed your answer...
IMPLEMENT_SREIAL( CDrawRect, CDrawObj, 0) ;
but, this error occor!!!
------

C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(458) : error C2059: syntax error : 'constant'

draw.exe - 1 error(s), 0 warning(s)
------
Avatar of k1024
k1024

ASKER

Edited text of question
Can you pls post more code and mark the line 458. It's hard to see the error without code.
You may continue your another question with more comments since the problem has not yet been solved. It is difficult to find out the problem because there is no context. Delete this question to save your points.
Avatar of k1024

ASKER

---line455~463
///////////////////////
//CDrawRect

IMPLEMENT_SREIAL( CDrawRect, CDrawObj, 0) ;

CDrawRect::CDrawRect()
{
      m_nCtrCount=8; //ÄÁÆ®·Ñ Æ÷ÀÎÆ®ÀÇ °¹¼ö
}
ASKER CERTIFIED SOLUTION
Avatar of rbr
rbr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of k1024

ASKER

protected:
int m_nCtrCount;
>How is m_nCtrCount declared. If it is a constant you can't assign a value.

If it was a constant, the error message would not have been "error C2059: syntax error : 'constant'".

Try removing the ';' at the end of the IMPLEMENT_SREIAL line to see what happens.
k1024,
     I was trying to save you 200 points.  That's, why I said to ask a 0 point question.
   If you try to send me the code, I'll see if I can compile it.  My e-mail address is nietod@theshop.net.

rbr,
   rbr, your answer is really a question, not an answer.  A question that cost k1024 200 points.

EXPERTS
The code appears in the original question asked by k1024.  You can look at it there.  But beware he posted the entire code 2 times.  At 28.8 it takes about 5 minutes to load and has a very bad impact on ones computer performance.  Apparently large web pages aren't a good idea.

Avatar of k1024

ASKER

C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(458) : error C2059: syntax error : 'constant'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(460) : error C2321: syntax error : unexpected 'CDrawRect::CDrawRect::CDrawRectCDrawRect::CDrawRect'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(463) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(469) : error C2501: 'm_nCtrCount' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(470) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(476) : error C2065: 'ar' : undeclared identifier
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(476) : error C2501: 'Serialize' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(476) : error C2350: 'CDrawObj::Serialize' is not a static member
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(477) : error C2143: syntax error : missing ';' before 'if'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(481) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(485) : error C2501: 'ar' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(485) : error C2239: unexpected token '>>' following declaration of 'ar'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(485) : error C2059: syntax error : '>>'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(486) : error C2501: 'm_nShape' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(486) : error C2065: 'wTemp' : undeclared identifier
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(488) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(499) : error C2143: syntax error : missing ';' before 'if'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(501) : error C2143: syntax error : missing ';' before 'if'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(504) : error C2501: 'pOldBrush' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(504) : error C2371: 'pOldBrush' : redefinition; different basic types
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(504) : error C2065: 'pDC' : undeclared identifier
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(504) : error C2227: left of '->SelectObject' must point to class/struct/union
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(505) : error C2501: 'pOldPen' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(505) : error C2371: 'pOldPen' : redefinition; different basic types
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(505) : error C2227: left of '->SelectObject' must point to class/struct/union
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(506) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(510) : error C2501: 'logPen' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(510) : error C2239: unexpected token '.' following declaration of 'logPen'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(510) : error C2059: syntax error : '.'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(511) : error C2501: 'logPen' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(511) : error C2086: 'logPen' : redefinition
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(511) : error C2239: unexpected token '.' following declaration of 'logPen'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(511) : error C2059: syntax error : '.'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(512) : error C2501: 'logPen' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(512) : error C2086: 'logPen' : redefinition
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(512) : error C2239: unexpected token '.' following declaration of 'logPen'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(512) : error C2059: syntax error : '.'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(514) : error C2143: syntax error : missing ';' before 'if'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(515) : error C2501: 'pOldBrush' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(515) : error C2371: 'pOldBrush' : redefinition; different basic types
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(515) : error C2227: left of '->SelectStockObject' must point to class/struct/union
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(516) : error C2501: 'pOldPen' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(516) : error C2371: 'pOldPen' : redefinition; different basic types
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(516) : error C2227: left of '->SelectObject' must point to class/struct/union
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(518) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(521) : error C2143: syntax error : missing ';' before 'switch'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(525) : error C2143: syntax error : missing ';' before 'break'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(526) : error C2143: syntax error : missing ';' before 'case'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(528) : error C2143: syntax error : missing ';' before 'break'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(529) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(531) : error C2501: 'pDC' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(531) : error C2239: unexpected token '->' following declaration of 'pDC'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(531) : error C2059: syntax error : '->'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(532) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(539) : error C2065: 'm_rect' : undeclared identifier
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(540) : error C2501: 'pClone' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(540) : error C2371: 'pClone' : redefinition; different basic types
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(540) : error C2239: unexpected token '->' following declaration of 'pClone'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(540) : error C2059: syntax error : '->'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(541) : error C2501: 'pClone' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(541) : error C2371: 'pClone' : redefinition; different basic types
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(541) : error C2239: unexpected token '->' following declaration of 'pClone'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(541) : error C2059: syntax error : '->'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(542) : error C2501: 'pClone' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(542) : error C2371: 'pClone' : redefinition; different basic types
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(542) : error C2239: unexpected token '->' following declaration of 'pClone'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(542) : error C2059: syntax error : '->'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(543) : error C2501: 'pClone' : missing decl-specifiers
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(543) : error C2371: 'pClone' : redefinition; different basic types
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(543) : error C2239: unexpected token '->' following declaration of 'pClone'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(543) : error C2059: syntax error : '->'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(544) : error C2061: syntax error : identifier 'pClone'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(544) : error C2244: 'AfxAssertValidObject' : unable to resolve function overload
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(547) : error C2143: syntax error : missing ';' before 'if'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(549) : error C2143: syntax error : missing ';' before 'return'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(550) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\DevStudio\MyProjects\draw\DrawObj.cpp(555) : fatal error C1903: unable to recover from previous error(s); stopping compilation
DrawTool.cpp
drawView.cpp
MainFrm.cpp
ToolBar.cpp
Generating Code...
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '.\Debug\DrawObj.sbr': No such file or directory
Error executing bscmake.exe.

draw.exe - 78 error(s), 0 warning(s)
-----
if removing ';' , then above error!!!!
Do you have DECLARE_SERIAL(CDrawRect) inside the class declaration in the header file?