GDI+: error C2660: 'new' : function does not take 3 parameters--MFC
2011-12-27 16:14
471 查看
在用GDI+写程序时,有
bmp = new Bitmap(L"E:\\1.png");
用VC6 SP6或VS2005编译错误为error C2660: 'new' : function does not take 3 parameters
这是VC的一个BUG,微软至今还没有解除。
解决办法如下:
法一:在该CPP文件开头部分注释掉#define
new DEBUG_NEW
[align=left]#ifdef _DEBUG[/align]
[align=left]//#define new DEBUG_NEW[/align]
[align=left]#undef THIS_FILE[/align]
static charTHIS_FILE[]
= __FILE__;
#endif
建议法二:在GdiplusBase.h文件中class GdiplusBase中添加如下代码
//////////////////////////////////////////////////////////////////////////
void * (operator new)(size_t nSize, LPCSTR lpszFileName, int nLine)
{
return DllExports::GdipAlloc(nSize);
}
void operator delete(void* p, LPCSTR lpszFileName, int nLine)
{
DllExports::GdipFree(p);
}
//////////////////////////////////////////////////////////////////////////
引用自http://www.cnblogs.com/carekee/articles/2038116.html
bmp = new Bitmap(L"E:\\1.png");
用VC6 SP6或VS2005编译错误为error C2660: 'new' : function does not take 3 parameters
这是VC的一个BUG,微软至今还没有解除。
解决办法如下:
法一:在该CPP文件开头部分注释掉#define
new DEBUG_NEW
[align=left]#ifdef _DEBUG[/align]
[align=left]//#define new DEBUG_NEW[/align]
[align=left]#undef THIS_FILE[/align]
static charTHIS_FILE[]
= __FILE__;
#endif
建议法二:在GdiplusBase.h文件中class GdiplusBase中添加如下代码
//////////////////////////////////////////////////////////////////////////
void * (operator new)(size_t nSize, LPCSTR lpszFileName, int nLine)
{
return DllExports::GdipAlloc(nSize);
}
void operator delete(void* p, LPCSTR lpszFileName, int nLine)
{
DllExports::GdipFree(p);
}
//////////////////////////////////////////////////////////////////////////
引用自http://www.cnblogs.com/carekee/articles/2038116.html
相关文章推荐
- VS2008中使用GDI+(error C2660: 'new' : function does not take 3 parameters)
- VC GDI+: error C2660: 'new' : function does not take 3 parameters
- VC GDI+: error C2660: 'new' : function does not take 3 parameters
- 微软VC各版本BUG: error C2660: 'new' : function does not take 3 parameters[转]
- VC GDI+: error C2660: 'new' : function does not take 3 parameters
- error C2660: 'new' : function does not take 3 parameters
- 微软VC各版本BUG: error C2660: 'new' : function does not take 3 parameters
- error C2660: 'Gdiplus::GdiplusBase::operator new' : function does not take 3 parameters
- 微软VC各版本BUG: error C2660: 'new' : function does not take 3 parameters
- error C2660: 'new' : function does not take 3 parameters
- error C2660: 'new' : function does not take 3 parameters
- 微软VC各版本BUG: error C2660: 'new' : function does not take 3 parameters
- error C2660: 'SaveAs' : function does not take 11 parameters
- 'new' : function does not take 3 parameters(转载)
- error C2660: 'Open' : function does not take 12 parameters
- error C2660: 'Gdiplus::GdiplusBase::operator new' : function does not take 3 parameters
- VC GDI+: error C2660: 'new' : function does not take 3 parameters
- 'MessageBoxA' : function does not take 1 parameters
- 【编程语言】MFC--'MessageBoxA' : function does not take 1 parameter
- 'new' : function does not take 3 parameters(部分转载)