C++/MFC

Advertisement


Question
My 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;

Answer
Hello 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.  

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Zlatko

Expertise

No longer taking questions.

Experience

No longer taking questions.

Education/Credentials
No longer taking questions.

©2016 About.com. All rights reserved.