テキストファイルを読込
void xxxxxx::GetTextData(CString strFilePath, CStringArray& strArrTextData)
{
// パラメータ格納データ
char buf[1000];
CString strBuf;
CString str;
// ファイル読込み
CStdioFile fin;
int curPos = 0;
if( !fin.Open( strFilePath, CFile::modeRead | CFile::typeText) ){
CString error;
error.Format(_T("Error Read File %s"), strFilePath );
::AfxMessageBox(error);
return;
}
CString strW;
while( fin.ReadString( strW ) ){
CStringW strBufW = strBuf;
strArrTextData.Add( strW );
}
_wsetlocale(LC_ALL, _T(""));
}
void xxxxxx::GetTextData(CString strFilePath, CStringArray& strArrTextData)
{
// パラメータ格納データ
char buf[1000];
CString strBuf;
CString str;
// ファイル読込み
CStdioFile fin;
int curPos = 0;
if( !fin.Open( strFilePath, CFile::modeRead | CFile::typeText) ){
CString error;
error.Format(_T("Error Read File %s"), strFilePath );
::AfxMessageBox(error);
return;
}
CString strW;
while( fin.ReadString( strW ) ){
CStringW strBufW = strBuf;
strArrTextData.Add( strW );
}
_wsetlocale(LC_ALL, _T(""));
}
PR
この記事にコメントする