Click here to Skip to main content
15,896,278 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Dialogbox doesn't appear when Treelist control added Pin
nitingonsalves11-Feb-03 10:35
nitingonsalves11-Feb-03 10:35 
GeneralRe: Dialogbox doesn't appear when Treelist control added Pin
nitingonsalves11-Feb-03 10:46
nitingonsalves11-Feb-03 10:46 
GeneralTaskbar HELP! - MFC/C++ Pin
mister trunks11-Feb-03 8:54
mister trunks11-Feb-03 8:54 
GeneralShow macro code expanded in Visual Studio Pin
Aaron Schaefer11-Feb-03 8:21
Aaron Schaefer11-Feb-03 8:21 
GeneralRe: Show macro code expanded in Visual Studio Pin
Michael Dunn11-Feb-03 8:28
sitebuilderMichael Dunn11-Feb-03 8:28 
Generalround off problem Pin
wong190711-Feb-03 8:14
wong190711-Feb-03 8:14 
GeneralRe: round off problem Pin
Rickard Andersson2011-Feb-03 8:27
Rickard Andersson2011-Feb-03 8:27 
GeneralRe: round off problem Pin
PJ Arends11-Feb-03 8:35
professionalPJ Arends11-Feb-03 8:35 
GeneralRe: round off problem Pin
PJ Arends11-Feb-03 8:31
professionalPJ Arends11-Feb-03 8:31 

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.