c++ - how to Display error message in console mode in VC++? -
i working on vc++ windows application support gui non-gui based execution. non gui based execution designed console mode purpose. now, if executed application in gui mode can show message box user acknowledgement in case of error or exception.
but in console mode, have execute
c:> myapp.exe -options -ms yes
if user type above command without "-options"keyword. want display error message in console mode.
the idea check options
key entered , exit if not. approximate code of solution:
int main(int argc, char** argv) { if (...) // check options presence here { cerr << "myapp should run myapp.exe -options -ms yes" << endl; return 0; } ... // actual work here }
Comments
Post a Comment