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

C / C++ / MFC

 
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 
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 
I suspected this. So how does one extract the words buried in a string which has nulls between words?

I have stuff like "abc\0aaa\0ddd\0" which is my attempt at saying I've got nulls between words? I'm using this:
<br />
void CTrain1View::popDisplayList(int popDisplayFlag, char * buffer)<br />
{<br />
//keywords are stored in a string returned by the dll.delimited with nulls.<br />
//lets extract them<br />
if (popDisplayFlag)<br />
{<br />
char* pc;<br />
 <br />
CString string;<br />
int nListIndex = 0;<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; // if we find a comma we replace it with a null character, if we didn't find a comma then the word is already null-terminated<br />
 //////////////////////////////////////////////////////////////////////////////////////////////////////<br />
	string = pc;<br />
	int nItem = m_listdisplay.InsertItem(nListIndex,string);<br />
<br />
 }<br />
<br />

but my listbox gets one extra line of garbage after the first five (buffer has five words in it, commma delimited)entries. I dont see why.

Any clues? I do thank you for confirming my suspicion regarding the buffers condition after putting in the nulls.
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 
AnswerRe: error LNK2001?? Pin
Le centriste24-Jul-02 8:03
Le centriste24-Jul-02 8:03 
Generalfind in vector !!! Pin
Hadi Rezaee24-Jul-02 6:31
Hadi Rezaee24-Jul-02 6:31 

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.