Click here to Skip to main content
15,920,670 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
madmax000121-Jun-06 9:09
madmax000121-Jun-06 9:09 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
Michael Dunn21-Jun-06 13:51
sitebuilderMichael Dunn21-Jun-06 13:51 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
madmax000121-Jun-06 22:06
madmax000121-Jun-06 22:06 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
Michael Dunn22-Jun-06 8:04
sitebuilderMichael Dunn22-Jun-06 8:04 
QuestionCstring to char * error Pin
kitty521-Jun-06 8:07
kitty521-Jun-06 8:07 
AnswerRe: Cstring to char * error Pin
Michael Dunn21-Jun-06 8:51
sitebuilderMichael Dunn21-Jun-06 8:51 
GeneralRe: Cstring to char * error Pin
kitty521-Jun-06 9:28
kitty521-Jun-06 9:28 
GeneralRe: Cstring to char * error Pin
Zac Howland21-Jun-06 9:35
Zac Howland21-Jun-06 9:35 
kitty5 wrote:
sscanf( userIn, "%s %s %s %s", device.GetBuffer(25), cmd.GetBuffer(25), input1.GetBuffer(25),


Don't use sscanf for string parameters; you will always get unexpected behaviors.

kitty5 wrote:
char *str = input1.GetBuffer();
AfxMessageBox(input1); //to check to see if input1 is still ok.
input1.ReleaseBuffer();


When you call GetBuffer, you cannot do ANYTHING with the CString object until you call ReleaseBuffer. In the above case, you should just be calling AfxMessageBox(input1); without the GetBuffer/ReleaseBuffer calls.

CString has an explicit conversion operator to LPCTSTR (which is a const TCHAR* -- which equates to const char* in non-UNICODE builds).

To simply your code, write a split function that takes a delimiter (which would be a space in this case) and parses a given CString and places the split CStrings into a CString Array. You will make your life much easier.


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
QuestionRe: Cstring to char * error Pin
David Crow21-Jun-06 9:38
David Crow21-Jun-06 9:38 
AnswerRe: Cstring to char * error Pin
Zac Howland21-Jun-06 13:20
Zac Howland21-Jun-06 13:20 
QuestionRe: Cstring to char * error Pin
David Crow22-Jun-06 2:33
David Crow22-Jun-06 2:33 
AnswerRe: Cstring to char * error Pin
Zac Howland22-Jun-06 3:20
Zac Howland22-Jun-06 3:20 
GeneralRe: Cstring to char * error Pin
David Crow22-Jun-06 3:35
David Crow22-Jun-06 3:35 
GeneralRe: Cstring to char * error Pin
Zac Howland22-Jun-06 3:39
Zac Howland22-Jun-06 3:39 
GeneralRe: Cstring to char * error Pin
kitty521-Jun-06 9:52
kitty521-Jun-06 9:52 
GeneralRe: Cstring to char * error Pin
David Crow21-Jun-06 10:15
David Crow21-Jun-06 10:15 
QuestionRe: Cstring to char * error Pin
David Crow21-Jun-06 9:36
David Crow21-Jun-06 9:36 
AnswerRe: Cstring to char * error Pin
kitty521-Jun-06 9:50
kitty521-Jun-06 9:50 
GeneralRe: Cstring to char * error Pin
David Crow21-Jun-06 10:16
David Crow21-Jun-06 10:16 
GeneralRe: Cstring to char * error Pin
Zac Howland21-Jun-06 13:23
Zac Howland21-Jun-06 13:23 
QuestionRe: Cstring to char * error Pin
David Crow21-Jun-06 9:12
David Crow21-Jun-06 9:12 
AnswerRe: Cstring to char * error [modified] Pin
kitty521-Jun-06 9:29
kitty521-Jun-06 9:29 
QuestionRe: Cstring to char * error Pin
David Crow21-Jun-06 9:35
David Crow21-Jun-06 9:35 
Questionlist in mfc Pin
kamalesh8221-Jun-06 7:42
kamalesh8221-Jun-06 7:42 
AnswerRe: list in mfc Pin
led mike21-Jun-06 7:55
led mike21-Jun-06 7:55 

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.