C++/MFC
Expert: Zlatko - 2/23/2011
QuestionMy simplest MFC application stopped working telling:
C2661: 'new' : no overloaded function takes 1 parameters.
My text is:
#include <afxwin.h>
class CMyMainWnd : public CFrameWnd{
public:
CMyMainWnd(){
Create(NULL,"My title");
}
};
As it did not work I reinstalled my MS VS 6.0 - no result. My impression is that include file is not included.
I shall be very thankful.
Olga
class CMyApp : public CWinApp{
public:
CMyApp(){}; virtual BOOL InitInstance (){
m_pMainWnd=new CMyMainWnd();
m_pMainWnd->ShowWindow(SW_SHOW);
return TRUE;
}
};
CMyApp theApp;
AnswerHello Olga
I cannot reproduce the problem with my Visual Studio 6. I would need to see your entire project to know what the problem is. However, I am suspicious about the line
#include <afxwin.h>
Generally afxwin.h is included in stdafx.h, and the stdafx.h also includes other necessary files. Try replacing
#include <afxwin.h>
with
#include "stdafx.h"
and make sure stdafx.h is the first included file. It will not work if it is not the first file.
If you want to send me your entire project, you can attach it as a zip file or compressed folder and send it to zlatko.c.help at gmail.com
Good luck.