I have tried multiple things but the base comes to this:
#include <stdio.h>
#include <afxwin.h>
main( int argc, const char* argv[] )
{
printf( "\nHello World\n\n" );
CDialog *dlg = new CDialog();
dlg->DoModal();
while (true) {
Sleep(1); // Sleep is a windows function
}
}
When I run this, I get the following error:
What am I missing for this dialog?
I looked up several resources, but everything results in the same error message.
Can someone tell me what am I not seeing?
Using the MFC in a console application requires some initializations. Without this you will get asserts.
You must also use a resource that is bound to the CDialog. You may use the appropriate constructors. Or you derive your own dialog from CDialog using the class wizard.
But it doesn't make sense to me to create an MFC console application and use dialogs... Your question may need more details, what you want to do, and why you want to do it in this way.
You may need to read some books or article before you continue this way of programming.