Click here to Skip to main content
15,924,367 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How do I change OnDraw?? Pin
NickOne24-Jul-02 11:34
NickOne24-Jul-02 11:34 
GeneralRe: How do I change OnDraw?? Pin
Chris Losinger24-Jul-02 11:37
professionalChris Losinger24-Jul-02 11:37 
GeneralRe: How do I change OnDraw?? Pin
Paul M Watt24-Jul-02 19:39
mentorPaul M Watt24-Jul-02 19:39 
QuestionHow do l execute a program from within the code? Pin
citress24-Jul-02 10:38
citress24-Jul-02 10:38 
AnswerRe: How do l execute a program from within the code? Pin
Ravi Bhavnani24-Jul-02 10:51
professionalRavi Bhavnani24-Jul-02 10:51 
AnswerRe: How do l execute a program from within the code? Pin
Georg Haan24-Jul-02 10:54
Georg Haan24-Jul-02 10:54 
AnswerRe: How do l execute a program from within the code? Pin
Todd Smith24-Jul-02 14:00
Todd Smith24-Jul-02 14:00 
Generalpuzzling question about pointers - *char Pin
ns24-Jul-02 10:37
ns24-Jul-02 10:37 
For the following code
int DLLGetKeywords( char* keyBuf)<br />
{<br />
char buffer[] = " type1,depth,type2,range,type3*";<br />
*strchr(buffer,'*') = 0; //double null now<br />
AfxMessageBox(buffer);  //////msgbox1<br />
<br />
///////////////////////////////////////////////////////////////<br />
	char *pc,*pc1;<br />
  for (pc = buffer ; *pc ; pc = strchr(pc,0) + 1) <br />
 {<br />
	// if we got here there must be a word<br />
 <br />
 	char* pc1 = strchr(pc,','); // search for a comma, returns a null pointer if not found<br />
	if (pc1) *pc1 = 0; <br />
  }<br />
<br />
<br />
  //////////////////////////////////////////////////<br />
strcpy(keyBuf,buffer);<br />
AfxMessageBox(buffer);
//////////////msgbox2



The first msgbox has an output as expected: " type1,depth,type2,range,type3*"
The second msgbox has an output of "type1". Thats all.

ALl thats happening in the routine is that commas are being replaced by nulls. I thought that its because the msgbox only "reads" upto the first null. But when I go to populate a listbox with this buffer, (post messagebox2), i only get "type1" in it.

Any light on this mystery?

Thanks,
ns
GeneralRe: puzzling question about pointers - *char Pin
David Chamberlain24-Jul-02 10:42
David Chamberlain24-Jul-02 10:42 
GeneralThank you.- another related question: Pin
ns24-Jul-02 10:58
ns24-Jul-02 10:58 
GeneralRe: Thank you.- another related question: Pin
David Chamberlain24-Jul-02 11:05
David Chamberlain24-Jul-02 11:05 
GeneralRe: Thank you.- another related question: Pin
ns25-Jul-02 1:19
ns25-Jul-02 1:19 
GeneralRe: puzzling question about pointers - *char Pin
Ravi Bhavnani24-Jul-02 10:49
professionalRavi Bhavnani24-Jul-02 10:49 
GeneralRe: puzzling question about pointers - *char Pin
ns25-Jul-02 1:18
ns25-Jul-02 1:18 
GeneralRe: puzzling question about pointers - *char Pin
Ravi Bhavnani25-Jul-02 2:36
professionalRavi Bhavnani25-Jul-02 2:36 
GeneralNever mind... Pin
Ravi Bhavnani25-Jul-02 2:37
professionalRavi Bhavnani25-Jul-02 2:37 
QuestionCan you create two CDialogBars in a frame window? Pin
JohnnyG24-Jul-02 10:28
JohnnyG24-Jul-02 10:28 
GeneralQuestion Mark Handling in ADO Pin
newlogsign24-Jul-02 9:52
newlogsign24-Jul-02 9:52 
QuestionHow do I prevent my application showing a button on the taskbar? Pin
adara24-Jul-02 8:09
adara24-Jul-02 8:09 
AnswerRe: How do I prevent my application showing a button on the taskbar? Pin
Ravi Bhavnani24-Jul-02 10:54
professionalRavi Bhavnani24-Jul-02 10:54 
AnswerRe: How do I prevent my application showing a button on the taskbar? Pin
J Patel24-Jul-02 10:57
J Patel24-Jul-02 10:57 
AnswerRe: How do I prevent my application showing a button on the taskbar? Pin
Paul M Watt24-Jul-02 20:02
mentorPaul M Watt24-Jul-02 20:02 
Generalmethod executing too many times Pin
mgriffith24-Jul-02 8:08
mgriffith24-Jul-02 8:08 
GeneralFonts Pin
Anonymous24-Jul-02 8:06
Anonymous24-Jul-02 8:06 
Questionerror LNK2001?? Pin
Jh324-Jul-02 7:11
Jh324-Jul-02 7:11 

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.