Solved

CMonthCalCtrl in VS2005

Posted on 2009-05-11
6
361 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
  • 2
  • 2
  • 2
6 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 400 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 100 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 100 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 400 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mobile phone 15 113
convert char array to number in c 5 85
How to debug Angular JS in Visual Studio 2013 2 170
How to convert MFC::CString to UTF8 wchar_t* 10 200
Let me explain this picture a little bit.  First, in case you haven't already guessed, you are looking at my 2 phones, an Android Samsung Galaxy S5 on the left and an iPhone 5 on the right.  They are on their respective cradles on my desk.  But, you…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

816 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now