Click here to Skip to main content
15,905,877 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Writing Files Pin
MAAK11-Feb-03 23:24
MAAK11-Feb-03 23:24 
GeneralRe: Writing Files Pin
orcblood12-Feb-03 10:58
orcblood12-Feb-03 10:58 
GeneralRe: Writing Files Pin
MAAK12-Feb-03 13:58
MAAK12-Feb-03 13:58 
GeneralCustom Dialogs Pin
orcblood11-Feb-03 13:40
orcblood11-Feb-03 13:40 
GeneralRe: Custom Dialogs Pin
PJ Arends11-Feb-03 13:47
professionalPJ Arends11-Feb-03 13:47 
GeneralRe: Custom Dialogs Pin
orcblood11-Feb-03 14:26
orcblood11-Feb-03 14:26 
GeneralRe: Custom Dialogs Pin
PJ Arends11-Feb-03 15:07
professionalPJ Arends11-Feb-03 15:07 
Generalwindow background Pin
Perseus11-Feb-03 13:09
Perseus11-Feb-03 13:09 
GeneralRe: window background Pin
HENDRIK R11-Feb-03 21:22
HENDRIK R11-Feb-03 21:22 
QuestionModeless Dialog Doesn't Destroy During WM_CLOSE? Pin
Dan Wilson11-Feb-03 11:19
Dan Wilson11-Feb-03 11:19 
AnswerRe: Modeless Dialog Doesn't Destroy During WM_CLOSE? Pin
Joaquín M López Muñoz11-Feb-03 11:26
Joaquín M López Muñoz11-Feb-03 11:26 
GeneralRe: Modeless Dialog Doesn't Destroy During WM_CLOSE? Pin
Dan Wilson12-Feb-03 3:23
Dan Wilson12-Feb-03 3:23 
AnswerRe: Modeless Dialog Doesn't Destroy During WM_CLOSE? Pin
valikac11-Feb-03 12:20
valikac11-Feb-03 12:20 
GeneralXML-safe strings, and iostreams Pin
Simon Steele11-Feb-03 11:10
Simon Steele11-Feb-03 11:10 
GeneralRe: XML-safe strings, and iostreams Pin
palbano11-Feb-03 11:13
palbano11-Feb-03 11:13 
GeneralRe: XML-safe strings, and iostreams Pin
Simon Steele11-Feb-03 11:42
Simon Steele11-Feb-03 11:42 
GeneralRe: XML-safe strings, and iostreams Pin
Simon Steele11-Feb-03 11:46
Simon Steele11-Feb-03 11:46 
Firstly, the above code contains a bug:

str += i;

should be:

str += buffer[i];

Also, I have found a simple way of using the above function with iostreams. It works like this:

struct FormatXML {
   tstring str_;
   explicit FormatXML(const tstring& str) : str_(str) { XMLSafeString(str_); }
   friend std::ostream& operator<<(std::ostream& s, const FormatXML& x)
   {
		s << x.str_;
		return s;
   }
};


This copies the input string, and performs the XML safety check on construction. The safe string is then passed into the stream. It would be used like this:

<br />
tstring str = _T("My string with \"Quotes\".");<br />
myostream << FormatXML(str);<br />


This isn't very efficient, however. Cry | :(( Therefore, I'm still on the lookout for cool code. Let me know!

--
Simon Steele
Programmers Notepad - http://www.pnotepad.org/
QuestionHow to draw password bullets in an edit control on XP? Pin
Brian Morearty11-Feb-03 10:30
Brian Morearty11-Feb-03 10:30 
AnswerRe: How to draw password bullets in an edit control on XP? Pin
MAAK12-Feb-03 0:02
MAAK12-Feb-03 0:02 
GeneralRe: How to draw password bullets in an edit control on XP? Pin
Brian Morearty12-Feb-03 5:47
Brian Morearty12-Feb-03 5:47 
GeneralDynamic linkage Pin
RalfPeter11-Feb-03 10:25
RalfPeter11-Feb-03 10:25 
GeneralRe: Dynamic linkage Pin
Christian Graus11-Feb-03 11:13
protectorChristian Graus11-Feb-03 11:13 
GeneralRe: Dynamic linkage Pin
Chris Richardson11-Feb-03 11:24
Chris Richardson11-Feb-03 11:24 
GeneralDialogbox doesn't appear when Treelist control added Pin
nitingonsalves11-Feb-03 9:11
nitingonsalves11-Feb-03 9:11 
GeneralRe: Dialogbox doesn't appear when Treelist control added Pin
Michael Dunn11-Feb-03 9:29
sitebuilderMichael Dunn11-Feb-03 9:29 

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.