Click here to Skip to main content
15,927,907 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to extract a piece of the CString? Pin
Daniel Lohmann25-Jul-02 22:50
Daniel Lohmann25-Jul-02 22:50 
GeneralRe: how to extract a piece of the CString? Pin
Tomasz Sowinski25-Jul-02 23:36
Tomasz Sowinski25-Jul-02 23:36 
GeneralRe: how to extract a piece of the CString? Pin
Christian Graus26-Jul-02 1:58
protectorChristian Graus26-Jul-02 1:58 
GeneralRe: how to extract a piece of the CString? Pin
Tomasz Sowinski26-Jul-02 2:06
Tomasz Sowinski26-Jul-02 2:06 
GeneralRe: how to extract a piece of the CString? Pin
Christian Graus26-Jul-02 2:10
protectorChristian Graus26-Jul-02 2:10 
GeneralRe: how to extract a piece of the CString? Pin
Christian Graus26-Jul-02 1:57
protectorChristian Graus26-Jul-02 1:57 
GeneralRe: how to extract a piece of the CString? Pin
Daniel Lohmann26-Jul-02 6:20
Daniel Lohmann26-Jul-02 6:20 
GeneralRe: how to extract a piece of the CString? Pin
Christian Graus26-Jul-02 13:42
protectorChristian Graus26-Jul-02 13:42 
Daniel Lohmann wrote:
the standard does not ensure that the returned buffer is zero terminated

YEs, I've actually noticed that it isn't when using the memory window. But if you want zero terminated, then you're reading, not writing. In that case, c_str() is fine.


Daniel Lohmann wrote:
And those ostream concatenations tend to get really long and nearly unreadable:

printf( "Error %d (0x%x) in Module %s Line %d: %s.\n",
dwErrorCode, dwErrorCode, nLine, pszModule, pszMsg );

comes to

cout << "Error " << dwErrorCode << " (0x" << hex << dwErrorCode << ") in Module " << pszModule << "Line " << nLine << ": " << pszMsg << "." << endl;

I doubt that the above is really better to read, to write and especially to maintain.


You're kidding, right ? How is (0x%x) easy to ready, and not error prone ?



Christian

come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
GeneralRe: how to extract a piece of the CString? Pin
Daniel Lohmann27-Jul-02 6:46
Daniel Lohmann27-Jul-02 6:46 
AnswerRe: how to extract a piece of the CString? Pin
Ravi Bhavnani25-Jul-02 17:11
professionalRavi Bhavnani25-Jul-02 17:11 
GeneralRe: how to extract a piece of the CString? Pin
nss25-Jul-02 17:31
nss25-Jul-02 17:31 
GeneralRe: how to extract a piece of the CString? Pin
Ravi Bhavnani25-Jul-02 17:37
professionalRavi Bhavnani25-Jul-02 17:37 
GeneralRe: how to extract a piece of the CString? Pin
Stuart Dootson25-Jul-02 20:45
professionalStuart Dootson25-Jul-02 20:45 
AnswerRe: how to extract a piece of the CString? Pin
Michael Dunn26-Jul-02 3:39
sitebuilderMichael Dunn26-Jul-02 3:39 
GeneralRe: how to extract a piece of the CString? Pin
ns26-Jul-02 3:41
ns26-Jul-02 3:41 
GeneralReferencing a dialog Pin
Scott_Perham25-Jul-02 16:27
Scott_Perham25-Jul-02 16:27 
GeneralRe: Referencing a dialog Pin
Christian Graus25-Jul-02 16:39
protectorChristian Graus25-Jul-02 16:39 
GeneralRe: Referencing a dialog Pin
Ravi Bhavnani25-Jul-02 17:14
professionalRavi Bhavnani25-Jul-02 17:14 
QuestionHow do I switch views in an SDI? Pin
JohnnyG25-Jul-02 15:32
JohnnyG25-Jul-02 15:32 
AnswerRe: How do I switch views in an SDI? Pin
nss25-Jul-02 16:35
nss25-Jul-02 16:35 
GeneralRe: How do I switch views in an SDI? Pin
JohnnyG25-Jul-02 16:38
JohnnyG25-Jul-02 16:38 
Generaldownload file incorrect Pin
wangweisp25-Jul-02 14:49
wangweisp25-Jul-02 14:49 
GeneralStart Bar Question Pin
gekoscan25-Jul-02 14:21
gekoscan25-Jul-02 14:21 
GeneralRe: Start Bar Question Pin
-Dy26-Jul-02 0:20
-Dy26-Jul-02 0:20 
GeneralRe: Start Bar Question Pin
Dave Matrix26-Jul-02 2:02
Dave Matrix26-Jul-02 2:02 

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.