Question

I have just started working on CDialog classes. When I try to execute the following code, I am getting debug assertion failure.

#include "stdafx.h"
#include "resource.h"
#include <afxwin.h>
#include "dialog.h"
#include <Windows.h>


int _tmain(int argc, _TCHAR* argv[])
{
    dialog dial(NULL);
    dial.DoModal();
    return 0;
}

I have created a dialog resource and CDialogEx class named dialog. The error I am getting is "Debug Assertion Failed!

Program: ...pp_projects\ConsoleApplication1\Debug\ConsoleApplication1.exe File: f:\dd\vctools\vc7libs\ship\atlmfc\include\afxwin1.inl Line: 24" Can anyone give me a solution?

Was it helpful?

Solution

Your project name suggests that you have created a Win32 Console Application project and added the MFC stuff. What you need to create is a MFC Application project.

MFC can also be used in a console application, but then you would not show dialogs and you would need to initialize MFC first.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top