?
Solved

CMonthCalCtrl in VS2005

Posted on 2009-05-11
6
Medium Priority
?
370 Views
Last Modified: 2013-12-27
While trying to convert an eVC++ project to VS2005, when I do a build I get the following error:

error C2146: syntax error : missing ';' before identifier 'm_dateMatch'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int      
      

The line of code is:
CMonthCalCtrl      m_dateMatch;
0
Comment
Question by:Wanting2LearnMan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 1600 total points
ID: 24353828
Check to see if afxdtctl.h is in your stdafx.h
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
#endif

Open in new window

0
 

Author Comment

by:Wanting2LearnMan
ID: 24353912
It is in as follows:

#if defined(_AFXDLL)
#include <afxdtctl.h>            // MFC support for Internet Explorer 4 Common Controls
#endif

Thanks
0
 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 400 total points
ID: 24353986
>>>> CMonthCalCtrl      m_dateMatch;

There are two common reasons for that error:

1. The issue is not in that line but in the line before where for example you forgot the semicolon ; or have a colon : instead.

2. You forgot to include the header for the CMonthCalCtrl

The second is that mrjoltcola assumed.

If you include a new headerfile in one of your headers you might need to make a 'Rebuild all' after in case your project uses 'Precompiled Headers' (PCH).  AFAIK all VC versions have problems to regocnize reliably changes where a new PCH was needed to be built.
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.

 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 400 total points
ID: 24353991
>>>> #if defined(_AFXDLL)
That is only set in a dll project using MFC
0
 
LVL 40

Assisted Solution

by:mrjoltcola
mrjoltcola earned 1600 total points
ID: 24354001
Check that _AFXDLL is defined, or change to use the #ifdef I provided, it is possible the #if defined(_AFXDLL) is from older projects. I don't have any evc4 projects to refer to anymore so I cannot confirm.

Did you create a new project from scratch or convert the old one?
0
 

Author Comment

by:Wanting2LearnMan
ID: 24354066
I converted from an old project.

I could not find _AFXDLL  defined anywhere.  I used the code you provided and it has now got past this error.

Thanks all
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question