Click here to Skip to main content
15,926,062 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multiple Print calls from CMainFrame() Pin
dazinith23-May-02 6:13
dazinith23-May-02 6:13 
QuestionHow to add a macro to active document in MFC Pin
22-May-02 11:50
suss22-May-02 11:50 
QuestionHow to add automation methods and properties in VC++7.0 Pin
Tim Ranker22-May-02 11:46
Tim Ranker22-May-02 11:46 
AnswerRe: How to add automation methods and properties in VC++7.0 Pin
Tim Ranker22-May-02 12:48
Tim Ranker22-May-02 12:48 
Generalstd::string weird behaviour??¿?¿ Pin
Carlos Sánchez García22-May-02 10:27
Carlos Sánchez García22-May-02 10:27 
GeneralRe: std::string weird behaviour??¿?¿ Pin
Joaquín M López Muñoz22-May-02 10:43
Joaquín M López Muñoz22-May-02 10:43 
GeneralRe: std::string weird behaviour??¿?¿ Pin
Dean Goodman22-May-02 10:57
Dean Goodman22-May-02 10:57 
GeneralRe: std::string weird behaviour??¿?¿ Pin
Carlos Sánchez García22-May-02 23:12
Carlos Sánchez García22-May-02 23:12 
Hello,

Check this answer posted in codeguru forums by John Barton (thanks John) Smile | :)

[quote]

It is normal behaviour for a string class to not copy the data but instead to do reference counting (unless the strings are different, there is no need to have multiple copies of the data).

The problem with your program is that you declared the operator<< incorrectly.

You should have made the first argument a reference:

friend std::ostream& operator<<(std::ostream& os, const CHexString& hs)

You were having a problem because when you called operator<< without the first argument being a reference, it made a local copy of the stream, and then returned a reference to the local copy (which was destroyed when the function exited).

Best regards,
John


GeneralTwo questions: CFileDialog & vector Pin
Dean Goodman22-May-02 9:59
Dean Goodman22-May-02 9:59 
GeneralRe: Two questions: CFileDialog & vector Pin
Chris Losinger22-May-02 10:01
professionalChris Losinger22-May-02 10:01 
GeneralRe: Two questions: CFileDialog & vector Pin
Dean Goodman22-May-02 10:32
Dean Goodman22-May-02 10:32 
GeneralRe: Two questions: CFileDialog & vector Pin
Joaquín M López Muñoz22-May-02 11:08
Joaquín M López Muñoz22-May-02 11:08 
GeneralExtended MAPI vs. Outlook Object Model Pin
22-May-02 9:22
suss22-May-02 9:22 
GeneralInserting strings Pin
Emearg22-May-02 8:58
Emearg22-May-02 8:58 
GeneralRe: Inserting strings Pin
Carlos Antollini22-May-02 9:25
Carlos Antollini22-May-02 9:25 
GeneralRe: Inserting strings Pin
Dean Goodman22-May-02 10:02
Dean Goodman22-May-02 10:02 
GeneralRe: Inserting strings Pin
Emearg23-May-02 5:41
Emearg23-May-02 5:41 
GeneralSearching for files in a specific folder and it's subfolders. Pin
redeemer22-May-02 8:58
redeemer22-May-02 8:58 
GeneralRe: Searching for files in a specific folder and it's subfolders. Pin
Chris Losinger22-May-02 9:07
professionalChris Losinger22-May-02 9:07 
GeneralRe: Searching for files in a specific folder and it's subfolders. Pin
redeemer22-May-02 9:09
redeemer22-May-02 9:09 
GeneralRe: Searching for files in a specific folder and it's subfolders. Pin
Chris Losinger22-May-02 9:12
professionalChris Losinger22-May-02 9:12 
GeneralRe: Searching for files in a specific folder and it's subfolders. Pin
Mazdak22-May-02 9:21
Mazdak22-May-02 9:21 
GeneralRe: Searching for files in a specific folder and it's subfolders. Pin
Martin Ziacek22-May-02 9:24
Martin Ziacek22-May-02 9:24 
GeneralWould it work if i did this: Pin
redeemer22-May-02 9:54
redeemer22-May-02 9:54 
GeneralAVIFile & audio Pin
Zizilamoroso22-May-02 8:33
Zizilamoroso22-May-02 8:33 

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.