Solved

CMonthCalCtrl in VS2005

Posted on 2009-05-11
6
355 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A short article about problems I had with the new location API and permissions in Marshmallow
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.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

760 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

18 Experts available now in Live!

Get 1:1 Help Now