command line
-
Hi All, consider Test.exe which is GUI based, now in command line \\directory\test.exe it invokes Test.exe, if user types \\directory\test.exe help ,particular help should be displayed simillar to c:\help a list of commands with description is displayed can anyone explain me on how to do this Thanks Uday
-
Hi All, consider Test.exe which is GUI based, now in command line \\directory\test.exe it invokes Test.exe, if user types \\directory\test.exe help ,particular help should be displayed simillar to c:\help a list of commands with description is displayed can anyone explain me on how to do this Thanks Uday
Parse the command line parameter of
WinMain()
, determine if the commandline included help, then print the stuff to screen. console apps I guess usemain()
so you have to work withargv
andargc
argv is an array (if i remember correctly) of each paramter and argc is a count of the number of array elements... so argv[0] = test.exe (module name) and argv[1] would contain the text string help simple as that really "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr -
Parse the command line parameter of
WinMain()
, determine if the commandline included help, then print the stuff to screen. console apps I guess usemain()
so you have to work withargv
andargc
argv is an array (if i remember correctly) of each paramter and argc is a count of the number of array elements... so argv[0] = test.exe (module name) and argv[1] would contain the text string help simple as that really "An expert is someone who has made all the mistakes in his or her field" - Niels BohrI need to use WriteConsole for that I have to get the Handle (Handle to the console screen buffer to be written to. The handle must have GENERIC_WRITE access. ) How to get this Handle?? I used , HANDLE hnd =GetStdHandle(STD_OUTPUT_HANDLE); buts its not working and also I used GetLastError() its returning 0 which means program executed correctly So ??
-
I need to use WriteConsole for that I have to get the Handle (Handle to the console screen buffer to be written to. The handle must have GENERIC_WRITE access. ) How to get this Handle?? I used , HANDLE hnd =GetStdHandle(STD_OUTPUT_HANDLE); buts its not working and also I used GetLastError() its returning 0 which means program executed correctly So ??
Are you using WinMain(...) or main(...). If you use WinMain, you have to call the function
AllocConsole();
before calling GetStdHandle(...); :-D -Dominik