|
|
|
Name: CommandLine What is it: Parsing the commandline. Features:
The Code: VOID ParseCommandLine( LPTSTR lpcmdline ) {TCHAR ch; LPTSTR pname; TCHAR szbufW[32]; // Follow this pattern strictly: // /O // Look for an option, which will be prefaced with '/' or '-' if (ch == '/' || ch == '-'){ ch = *lpcmdline++; switch (ch) { case 'O': //Do stuff break; default: wsprintf(szbufW,_T("%c is an invalid switch."), ch) MessageBox (NULL, _T("%c is an invalid switch\n"), NULL, MB_OK); return; } //whitepace after option switch while (isspace(ch)){ ch = *lpcmdline++; } } // Look for a string while (ch){ *p++ = ch; ch = *lpcmdline++; } *p = '\0'; _tcsupr(p); return; } This page was last updated on 06/03/99. |
|
Feedback mailto:ppcdev@conduits.com |