Click here to Skip to main content
15,888,461 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: problem with using program Creating a Serial communication on Win32 Pin
sindbad1128-May-13 23:49
sindbad1128-May-13 23:49 
GeneralRe: problem with using program Creating a Serial communication on Win32 Pin
Jochen Arndt29-May-13 0:31
professionalJochen Arndt29-May-13 0:31 
GeneralRe: problem with using program Creating a Serial communication on Win32 Pin
sindbad1112-Aug-13 1:19
sindbad1112-Aug-13 1:19 
GeneralRe: problem with using program Creating a Serial communication on Win32 Pin
Jochen Arndt16-Aug-13 2:52
professionalJochen Arndt16-Aug-13 2:52 
General: problem with using program Creating a Serial communication on Win32 Pin
sindbad116-Sep-13 23:29
sindbad116-Sep-13 23:29 
GeneralRe: : problem with using program Creating a Serial communication on Win32 Pin
Jochen Arndt6-Sep-13 23:45
professionalJochen Arndt6-Sep-13 23:45 
GeneralRe: : problem with using program Creating a Serial communication on Win32 Pin
sindbad117-Sep-13 0:08
sindbad117-Sep-13 0:08 
GeneralRe: : problem with using program Creating a Serial communication on Win32 Pin
Jochen Arndt7-Sep-13 0:28
professionalJochen Arndt7-Sep-13 0:28 
Still wrong. As I told you, indexes are zero-based. So you must use 3 as start index. To get the length, subtract the start position from the position of 'kg'. Also there is no need to mix CString and std::string:
C++
CString cs(mess); // copy mess to CString object
int nStart = 3; // start at 4th character
int nStop = cs.Find("kg"); // get position of 'kg'
cs = cs.Mid(nStart, nEnd - nStart); // extract the weight value

If you want to get numeric values from strings, use the atoi() function:
C++
int nWeight = atoi(mess + 3);

The atoi() function will parse the string stopping at the first non-digit char and return the converted value.
GeneralRe: : problem with using program Creating a Serial communication on Win32 Pin
sindbad117-Sep-13 0:56
sindbad117-Sep-13 0:56 
GeneralRe: : problem with using program Creating a Serial communication on Win32 Pin
Jochen Arndt7-Sep-13 2:31
professionalJochen Arndt7-Sep-13 2:31 
QuestionCoding guidelines C Pin
topcatalpha27-May-13 2:56
topcatalpha27-May-13 2:56 
QuestionRe: Coding guidelines C Pin
Maximilien27-May-13 7:08
Maximilien27-May-13 7:08 
AnswerRe: Coding guidelines C Pin
topcatalpha28-May-13 20:41
topcatalpha28-May-13 20:41 
QuestionPlaySoundA does not return within injected DLL Pin
Furblog Sidloth26-May-13 0:42
Furblog Sidloth26-May-13 0:42 
SuggestionRe: PlaySoundA does not return within injected DLL Pin
Richard MacCutchan26-May-13 0:54
mveRichard MacCutchan26-May-13 0:54 
GeneralRe: PlaySoundA does not return within injected DLL Pin
Furblog Sidloth26-May-13 20:39
Furblog Sidloth26-May-13 20:39 
GeneralRe: PlaySoundA does not return within injected DLL Pin
Richard MacCutchan26-May-13 21:38
mveRichard MacCutchan26-May-13 21:38 
GeneralRe: PlaySoundA does not return within injected DLL Pin
Erudite_Eric27-May-13 5:48
Erudite_Eric27-May-13 5:48 
GeneralRe: PlaySoundA does not return within injected DLL Pin
Richard MacCutchan27-May-13 5:53
mveRichard MacCutchan27-May-13 5:53 
GeneralRe: PlaySoundA does not return within injected DLL Pin
Erudite_Eric27-May-13 10:54
Erudite_Eric27-May-13 10:54 
GeneralRe: PlaySoundA does not return within injected DLL Pin
Richard MacCutchan27-May-13 20:59
mveRichard MacCutchan27-May-13 20:59 
QuestionModeless Dialog CricheditCtrl Issues Pin
ForNow25-May-13 19:34
ForNow25-May-13 19:34 
AnswerRe: Modeless Dialog CricheditCtrl Issues Pin
Richard MacCutchan26-May-13 0:45
mveRichard MacCutchan26-May-13 0:45 
GeneralRe: Modeless Dialog CricheditCtrl Issues Pin
ForNow26-May-13 2:29
ForNow26-May-13 2:29 
GeneralRe: Modeless Dialog CricheditCtrl Issues Pin
Richard MacCutchan26-May-13 2:32
mveRichard MacCutchan26-May-13 2:32 

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.