E
Danke für die Antwort
Und sorry für die dumme gegenfrage: An welcher Stelle muss ich das einsetzen?
CString Dateiname = ".\\logfile.txt";
CString csTmp, csText, csRekorder, csVersion;
CStdioFile file;
DWORD dwread;
string::size_type pos;
schrift.CreateFont(14, 0, 0, 0, 200, 0, 0, 0, 1, 1, 0, 1, 2, "Courier New");
m_cEdit.SetFont(&schrift);
file.Open(Dateiname, CFile::typeText | CFile::modeRead);
do
{
dwread = file.ReadString(csTmp);
pos = csTmp.Find("Recorder:");
if(pos != string::npos)
{
csRekorder = csTmp;
}
} while (dwread > 0);
file.Close();
AfxMessageBox("Found " + csRekorder + " and " + csVersion, MB_OK | MB_ICONASTERISK);
char string[] = csRekorder;
char seps[] = " ,\t\n";
char *token;
void main( void )
{
printf( "%s\n\nTokens:\n", string );
/* Establish string and get the first token: */
token = strtok( string, seps );
while( token != NULL )
{
/* While there are tokens in "string" */
printf( " %s\n", token );
/* Get next token: */
token = strtok( NULL, seps );
}
}