Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/133.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 简单显示窗口程序给出错误VS2012_C++_Windows_Mfc - Fatal编程技术网

C++ 简单显示窗口程序给出错误VS2012

C++ 简单显示窗口程序给出错误VS2012,c++,windows,mfc,C++,Windows,Mfc,我也犯了同样的错误,用这种方法解决了我的问题。如果有人遇到同样的问题,你可以使用这个解决方案 MFC编程中的这些问题通常发生在项目设置未正确设置时。 转到项目设置>链接器>系统 在子系统中选择:/subsystem:WINDOWS 这应该能奏效 所以。。。哪一行是第182行?我不建议选择MFC作为库。这段代码在VS2013.2和VS2012.4中编译并运行良好。你安装了更新4吗?我在VS2012文件夹中的appcore.cpp的第182行没有看到断言,但该代码区域正在查找语言资源DLL。你使用的

我也犯了同样的错误,用这种方法解决了我的问题。如果有人遇到同样的问题,你可以使用这个解决方案

MFC编程中的这些问题通常发生在项目设置未正确设置时。 转到项目设置>链接器>系统

在子系统中选择:/subsystem:WINDOWS


这应该能奏效

所以。。。哪一行是第182行?我不建议选择MFC作为库。这段代码在VS2013.2和VS2012.4中编译并运行良好。你安装了更新4吗?我在VS2012文件夹中的appcore.cpp的第182行没有看到断言,但该代码区域正在查找语言资源DLL。你使用的是什么语言操作系统?还有,你的项目文件夹有多深,因为有一个断言说路径不是太长。我现在正在安装update 4。但是我不知道你在说什么。
#include<afxwin.h>
#include"stdafx.h"

class CSimpleFrame : public CFrameWnd
{
    public:
    CSimpleFrame()
    {
        Create(NULL,L"Windows Application");
    }       

};

struct CSimpleApp : public CWinApp
{
     BOOL InitInstance()
    {
        CSimpleFrame *Tester= new CSimpleFrame();
        m_pMainWnd=Tester;

        m_pMainWnd->ShowWindow(SW_SHOW);
        m_pMainWnd->UpdateWindow();

        return TRUE;
    }


};

CSimpleApp theApp;
    Debug Assertion Failed!
    Program: C:\Windows\system32\mfc110ud.dll
    File: f:\\dd\vctools\vc7libs\ship\atlmfc\src\mfc\appcore.cpp
    Line: 196

    **line 196 of appcore.cpp is**
    ASSERT(AfxGetThread() == NULL);
    When this error is shown i press retry.And then i press break and then continue then it gives another error
    Debug Assertion Failed!
    Program: C:\Windows\system32\mfc110ud.dll
    File: f:\\dd\vctools\vc7libs\ship\atlmfc\src\mfc\appcore.cpp
    Line: 203

    **line 203 of appcore.cpp is** 
    ASSERT(afxCurrentWinApp == NULL); // only one CWinApp object please