Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Applicatio crash Pin
Tim Craig19-Mar-10 19:59
Tim Craig19-Mar-10 19:59 
GeneralRe: Applicatio crash Pin
Rajesh R Subramanian19-Mar-10 22:07
professionalRajesh R Subramanian19-Mar-10 22:07 
QuestionHow to change frame / window focus programatically - after using SetWindowPos Pin
Vaclav_19-Mar-10 8:16
Vaclav_19-Mar-10 8:16 
AnswerRe: How to change frame / window focus programatically - after using SetWindowPos Pin
Rozis21-Mar-10 2:09
Rozis21-Mar-10 2:09 
GeneralRe: How to change frame / window focus programatically - after using SetWindowPos Pin
Vaclav_21-Mar-10 2:19
Vaclav_21-Mar-10 2:19 
AnswerRe: How to change frame / window focus programatically - after using SetWindowPos Pin
Avi Berger22-Mar-10 5:10
Avi Berger22-Mar-10 5:10 
GeneralRe: How to change frame / window focus programatically - after using SetWindowPos Pin
Vaclav_22-Mar-10 5:55
Vaclav_22-Mar-10 5:55 
QuestionDealing with const CString ... [modified] (FIXED). Pin
Maximilien19-Mar-10 4:26
Maximilien19-Mar-10 4:26 
(probably still a bit drunk after drinking too much Bandol wines last night).

I have a 2 small functions :

void Toto( const CString& s )
{
  std::stringstream ss(s.GetBuffer());
  // do some stuff with the ss string.
}
void Something( )
{
  CString s("some string");
  Toto ( s );
}


This obviously does not compile because I cannot get call GetBuffer on a const CString.

any other solution than making a copy of the input string in the function Toto ?
void Toto( const CString& s )
{
  CString s1 = s;
  std::stringstream ss(s1.GetBuffer());
  // do some stuff with the ss string.
}


Thanks.

Max.
Watched code never compiles.
modified on Friday, March 19, 2010 10:53 AM

AnswerRe: Dealing with const CString ... Pin
Cedric Moonen19-Mar-10 4:36
Cedric Moonen19-Mar-10 4:36 
GeneralRe: Dealing with const CString ... Pin
Maximilien19-Mar-10 4:53
Maximilien19-Mar-10 4:53 
GeneralRe: Dealing with const CString ... Pin
Cedric Moonen19-Mar-10 5:17
Cedric Moonen19-Mar-10 5:17 
GeneralRe: Dealing with const CString ... Pin
Maximilien19-Mar-10 5:24
Maximilien19-Mar-10 5:24 
AnswerRe: Dealing with const CString ... PinPopular
Rajesh R Subramanian19-Mar-10 4:43
professionalRajesh R Subramanian19-Mar-10 4:43 
GeneralRe: Dealing with const CString ... Pin
Maximilien19-Mar-10 4:54
Maximilien19-Mar-10 4:54 
GeneralRe: Dealing with const CString ... Pin
Rajesh R Subramanian19-Mar-10 5:10
professionalRajesh R Subramanian19-Mar-10 5:10 
GeneralRe: Dealing with const CString ... Pin
Cedric Moonen19-Mar-10 5:15
Cedric Moonen19-Mar-10 5:15 
GeneralRe: Dealing with const CString ... Pin
Rajesh R Subramanian19-Mar-10 5:16
professionalRajesh R Subramanian19-Mar-10 5:16 
GeneralRe: Dealing with const CString ... Pin
Joe Woodbury19-Mar-10 9:28
professionalJoe Woodbury19-Mar-10 9:28 
QuestionEditBox control Problem Pin
shiv@nand19-Mar-10 3:58
shiv@nand19-Mar-10 3:58 
AnswerRe: EditBox control Problem Pin
Adam Roderick J19-Mar-10 4:27
Adam Roderick J19-Mar-10 4:27 
AnswerRe: EditBox control Problem Pin
Le@rner20-Mar-10 1:38
Le@rner20-Mar-10 1:38 
QuestionList Control to Excel Pin
hellogany19-Mar-10 0:59
hellogany19-Mar-10 0:59 
AnswerRe: List Control to Excel Pin
CPallini19-Mar-10 1:20
mveCPallini19-Mar-10 1:20 
GeneralRe: List Control to Excel Pin
mesajflaviu19-Mar-10 1:59
mesajflaviu19-Mar-10 1:59 
AnswerRe: List Control to Excel Pin
Rajesh R Subramanian19-Mar-10 2:16
professionalRajesh R Subramanian19-Mar-10 2:16 

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.