Click here to Skip to main content
15,898,373 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralThe Noo-B Blues Pin
RedRabbit10910-Mar-04 11:19
RedRabbit10910-Mar-04 11:19 
GeneralRe: The Noo-B Blues Pin
Ravi Bhavnani10-Mar-04 11:39
professionalRavi Bhavnani10-Mar-04 11:39 
GeneralRe: The Noo-B Blues Pin
Snyp10-Mar-04 11:41
Snyp10-Mar-04 11:41 
Generaldisplay tooltips on CToolBarCtrl Pin
bin892210-Mar-04 10:50
bin892210-Mar-04 10:50 
GeneralRe: display tooltips on CToolBarCtrl Pin
casid10-Mar-04 12:21
casid10-Mar-04 12:21 
GeneralNeed some help on ClistCtrl Control Pin
pavneet10-Mar-04 10:39
pavneet10-Mar-04 10:39 
GeneralRe: Need some help on ClistCtrl Control Pin
Michael Dunn10-Mar-04 12:08
sitebuilderMichael Dunn10-Mar-04 12:08 
GeneralParseing a string question. Pin
modeonetwo10-Mar-04 10:18
modeonetwo10-Mar-04 10:18 
Hello all. I am having a very hard time parsing a string that i am reading from a line. I have been working on it since 2 days ago and can not get it right...Here is my code. If anyone could take the time and see what my problem is, it would take alot of discomfort and stress from my shoulders.
Here is my function where i am reading from a file, which seems to be working fine. buff is a local variable that i have initialized as follows
char buff[256];
//reading a file
void CTimeTrackerDlg::ReadLine()
{
ismanager = false;
while( !m_sfile.eof() ) {
m_sfile.getline( buff, 256 );
parse_string();

}
m_sfile.close();
fileopen = false;

}
Now here is where i parse the string. I tried this code in a consoule application which seems to be working, but as soon as i place it in my program, MFC, dialog application, it seems not to work.
void CTimeTrackerDlg::parse_string( )
{

char temp[256];
strcpy(temp,buff);
MessageBox(temp,"temp");

CString p,n;
char * pch;

pch = strtok (temp," ");
int count = 0;
while (pch != NULL)
{
if(count == 0)
{
p = pch;
count++;
}
else
{
n = pch;
}
pch = strtok (NULL, " ,.");
MessageBox(p,"password");
MessageBox(n,"name");

}

}
Agan, any help or solutions would be greatly appricated

none
GeneralRe: Parseing a string question. Pin
Branislav10-Mar-04 15:25
Branislav10-Mar-04 15:25 
GeneralRe: Parseing a string question. Pin
David Crow11-Mar-04 3:36
David Crow11-Mar-04 3:36 
GeneralIOCTL Pin
Dev57810-Mar-04 9:57
Dev57810-Mar-04 9:57 
GeneralRe: IOCTL Pin
David Crow10-Mar-04 10:10
David Crow10-Mar-04 10:10 
GeneralXP style project Pin
krugger10-Mar-04 8:16
krugger10-Mar-04 8:16 
GeneralRe: XP style project Pin
Christian Graus10-Mar-04 8:27
protectorChristian Graus10-Mar-04 8:27 
GeneralRe: XP style project Pin
Neville Franks10-Mar-04 10:33
Neville Franks10-Mar-04 10:33 
GeneralRe: XP style project Pin
Anonymous10-Mar-04 12:22
Anonymous10-Mar-04 12:22 
Questionnon XP visual style when using chtmlview in VC6/VC7 ?? Pin
karmafx10-Mar-04 7:42
karmafx10-Mar-04 7:42 
AnswerRe: non XP visual style when using chtmlview in VC6/VC7 ?? Pin
Neville Franks10-Mar-04 10:39
Neville Franks10-Mar-04 10:39 
AnswerRe: non XP visual style when using chtmlview in VC6/VC7 ?? Pin
karmafx10-Mar-04 10:46
karmafx10-Mar-04 10:46 
GeneralRe: non XP visual style when using chtmlview in VC6/VC7 ?? Pin
Neville Franks10-Mar-04 12:33
Neville Franks10-Mar-04 12:33 
GeneralRe: non XP visual style when using chtmlview in VC6/VC7 ?? Pin
karmafx10-Mar-04 21:45
karmafx10-Mar-04 21:45 
GeneralCHange Gradient Colors in WIndow Caption Pin
doctorpi10-Mar-04 7:13
doctorpi10-Mar-04 7:13 
GeneralRe: CHange Gradient Colors in WIndow Caption Pin
Robert A. T. Káldy11-Mar-04 1:34
Robert A. T. Káldy11-Mar-04 1:34 
GeneralFileWriting -> Arrays Pin
nsaddock10-Mar-04 6:02
nsaddock10-Mar-04 6:02 
GeneralRe: FileWriting -> Arrays Pin
David Crow10-Mar-04 10:06
David Crow10-Mar-04 10:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.