Click here to Skip to main content
16,011,611 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: strtok() argument Pin
Max++7-Sep-06 2:52
Max++7-Sep-06 2:52 
GeneralRe: strtok() argument Pin
Steve S7-Sep-06 2:59
Steve S7-Sep-06 2:59 
GeneralRe: strtok() argument Pin
prasad_som7-Sep-06 3:10
prasad_som7-Sep-06 3:10 
AnswerRe: strtok() argument Pin
David Crow7-Sep-06 3:12
David Crow7-Sep-06 3:12 
AnswerRe: strtok() argument Pin
Karthikeyan .g7-Sep-06 3:30
Karthikeyan .g7-Sep-06 3:30 
GeneralRe: strtok() argument Pin
toxcct7-Sep-06 3:41
toxcct7-Sep-06 3:41 
QuestionRe: strtok() argument Pin
David Crow7-Sep-06 5:34
David Crow7-Sep-06 5:34 
AnswerRe: strtok() argument Pin
Zac Howland7-Sep-06 5:07
Zac Howland7-Sep-06 5:07 
You do NOT want to pass in a CString's buffer to strtok. strtok changes the buffer it operates on. Thus, if you pass in the buffer returned from GetBuffer, it will change it and the original CString object will be invalidated (that is, the data will be changed) when you call ReleaseBuffer. Looking through what you want to do, just use something like:

void Split(CString strText, CString strSeparators, CStringArray& strArray)

{

	int start = 0;

	while (start >=0 && start < strText.GetLength())

	{

		int stop = strText.Find(strSeparators, start);

		if (stop < 0 || stop > strText.GetLength())

			stop = strText.GetLength();

		strArray.Add(strText.Mid(start, stop - start));

		start = stop + 1;

	}

}


The strArray parameter will hold the values you are looking for.

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

Questionexecute insert parametric queries of blob data type Pin
Mushtaque Nizamani7-Sep-06 1:22
Mushtaque Nizamani7-Sep-06 1:22 
QuestionRe: execute insert parametric queries of blob data type Pin
David Crow7-Sep-06 3:15
David Crow7-Sep-06 3:15 
AnswerRe: execute insert parametric queries of blob data type Pin
Mushtaque Nizamani7-Sep-06 5:58
Mushtaque Nizamani7-Sep-06 5:58 
AnswerRe: execute insert parametric queries of blob data type Pin
Mushtaque Nizamani7-Sep-06 6:02
Mushtaque Nizamani7-Sep-06 6:02 
GeneralRe: execute insert parametric queries of blob data type Pin
David Crow7-Sep-06 8:03
David Crow7-Sep-06 8:03 
QuestionRemoving Titlebar of the Frame Window Pin
Sarath C7-Sep-06 1:17
Sarath C7-Sep-06 1:17 
AnswerRe: Removing Titlebar of the Frame Window Pin
Rinu_Raj7-Sep-06 1:25
Rinu_Raj7-Sep-06 1:25 
GeneralRe: Removing Titlebar of the Frame Window Pin
Sarath C7-Sep-06 1:31
Sarath C7-Sep-06 1:31 
GeneralRe: Removing Titlebar of the Frame Window Pin
prasad_som7-Sep-06 1:42
prasad_som7-Sep-06 1:42 
GeneralRe: Removing Titlebar of the Frame Window Pin
Sarath C7-Sep-06 1:52
Sarath C7-Sep-06 1:52 
GeneralRe: Removing Titlebar of the Frame Window Pin
prasad_som7-Sep-06 1:55
prasad_som7-Sep-06 1:55 
GeneralRe: Removing Titlebar of the Frame Window Pin
Sarath C7-Sep-06 18:10
Sarath C7-Sep-06 18:10 
QuestionRe: Removing Titlebar of the Frame Window Pin
David Crow7-Sep-06 3:24
David Crow7-Sep-06 3:24 
Questiondebug Version crashing Pin
Jacqi1237-Sep-06 1:17
Jacqi1237-Sep-06 1:17 
AnswerRe: debug Version crashing Pin
Cedric Moonen7-Sep-06 1:22
Cedric Moonen7-Sep-06 1:22 
QuestionRe: debug Version crashing Pin
Rinu_Raj7-Sep-06 1:23
Rinu_Raj7-Sep-06 1:23 
AnswerRe: debug Version crashing Pin
Jacqi1237-Sep-06 1:30
Jacqi1237-Sep-06 1:30 

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.