접기
if ( AfxGetApp()->m_lpCmdLine[0] != _T('\\0') ) {
CString sCmdLine = AfxGetApp()->m_lpCmdLine ;
CString sFile;
int len = sCmdLine.GetLength();
int count;
sFile.Empty();
for ( count=0; count<len; count++ ) {
if ( sCmdLine.GetAt(count)!=_T(' ') ) {
sFile += sCmdLine.GetAt(count);
} else {
AddFile(sFile);
sFile.Empty();
}
}
AddFile(sFile);
UpdateData(FALSE);
}
접기 접기
DWORD Options(int argc, LPCTSTR argv[], LPCTSTR OptStr, ...)
{
va_list pFlagList;
LPBOOL pFlag;
int iFlag = 0, iArg;
va_start(pFlagList, OptStr);
while ((pFlag = va_arg(pFlagList, LPBOOL)) != NULL && iFlag < (int)_tcslen(OptStr)) {
*pFlag = FALSE;
for (iArg = 1; !(*pFlag) && iArg < argc && argv[iArg][0] == '-'; iArg++)
*pFlag = _memtchr(argv[iArg], OptStr[iFlag], _tcslen(argv[iArg])) != NULL;
iFlag++;
}
va_end(pFlagList);
for (iArg = 1; iArg < argc && argv[iArg][0] == '-'; iArg++) ;
return iArg;
}
접기