Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1091
  • Last Modified:

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)
------
0
k1024
Asked:
k1024
  • 4
  • 3
  • 2
  • +1
1 Solution
 
k1024Author Commented:
Edited text of question
0
 
rbrCommented:
Can you pls post more code and mark the line 458. It's hard to see the error without code.
0
 
chensuCommented:
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.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
k1024Author Commented:
---line455~463
///////////////////////
//CDrawRect

IMPLEMENT_SREIAL( CDrawRect, CDrawObj, 0) ;

CDrawRect::CDrawRect()
{
      m_nCtrCount=8; //ÄÁÆ®·Ñ Æ÷ÀÎÆ®ÀÇ °¹¼ö
}
0
 
rbrCommented:
How is m_nCtrCount declared. If it is a constant you can't assign a value.
0
 
k1024Author Commented:
protected:
int m_nCtrCount;
0
 
chensuCommented:
>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.
0
 
nietodCommented:
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.

0
 
k1024Author Commented:
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!!!!
0
 
chensuCommented:
Do you have DECLARE_SERIAL(CDrawRect) inside the class declaration in the header file?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now