c++ - How to make a CDialog? -
i have tryed multiple things base comes 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 windows function }
what missing dialog?
i looked multiple sites gets same error message.
can tell me not seeing?
using mfc in console application requires initializations. without asserts.
int _tmain(int argc, tchar* argv[], tchar* envp[]) { // initialize mfc , print , error on failure if (!afxwininit(::getmodulehandle(null), null, ::getcommandline(), 0)) { // todo: change error code suit needs _tprintf(_t("fatal error: mfc initialization failed\n")); return 8; }
you must use resource bound cdialog. may use appropriate constructors. or derive own dialog cdialog using class wizard.
but doesn't make sense me create mfc console application , use dialogs... question may need more details, want do, , why want in way.
you may need read books or article before continue way of programming.
Comments
Post a Comment