Click here to Skip to main content

Clever Code

RSS Feed RSS feed

Showcase your best code, your most elegant solution, or your most hard fought subtle bug you've found and fixed. Please, do not post programming questions in this forum - they will be removed.

 
GeneralRe: Call Dispose on anything PinmemberGideon Engelberth20-Oct-09 11:20 
GeneralRe: Call Dispose on anything Pinmembersupercat920-Oct-09 11:38 
GeneralRe: Call Dispose on anything PinmemberS. Senthil Kumar2-Nov-09 21:33 
GeneralRe: Call Dispose on anything PinmemberPaulo Zemek26-Oct-09 10:13 
AnswerHow about doing this instead... PinmemberDaniel Flower2-Nov-09 2:54 
GeneralRe: How about doing this instead... PinmemberPIEBALDconsult2-Nov-09 4:13 
General(C++) Trick or Treat ( Make/Expand our tricks.h file) [modified] PinmemberDaniel L Kelly12-Oct-09 15:24 
GeneralRe: (C++) Trick or Treat ( Make/Expand our tricks.h file) [modified] PinsitebuilderMichael Dunn13-Oct-09 9:13 
For quick loading of string resources:
#define _S(id) (CString(LPCTSTR(id)))
And use it like this:
MessageBox ( hwnd, _S(IDS_TITLE), _S(IDS_MESSAGE), MB_OK );
This constructor trick is actually documented, although I haven't seen it used too often. Note that this macro is the release version; the debug version is a real function that checks whether the LoadString() succeeds.
 
--Mike--
Dunder-Mifflin, this is Pam.
modified on Thursday, October 22, 2009 6:36 PM

GeneralRe: (C++) Trick or Treat ( Make/Expand our tricks.h file) Pinmembersashoalm16-Oct-09 22:10 
GeneralRe: (C++) Trick or Treat ( Make/Expand our tricks.h file) PinmemberJörgen Sigvardsson21-Oct-09 7:04 
GeneralA clever backup... PinmemberRozis12-Oct-09 11:07 
GeneralRe: A clever backup... PinmvpDave Kreskowiak12-Oct-09 16:13 
GeneralRe: A clever backup... PinmemberBizit Deb14-Oct-09 21:26 
GeneralRe: A clever backup... PinmemberLike2Byte18-Oct-09 10:07 
GeneralXml Serialization Bug + Control.Invoke Bug (Or: My Adventures In .NET!) [modified] PinmemberThe_Mega_ZZTer28-Sep-09 16:44 
GeneralRe: Xml Serialization Bug + Control.Invoke Bug (Or: My Adventures In .NET!) PinmemberBillWoodruff5-Oct-09 5:40 
GeneralDifferences between vb.net and c# Pinmemberadgonz24-Sep-09 9:25 
GeneralRe: Differences between vb.net and c# [modified] PinmvpLuc Pattyn24-Sep-09 9:50 
GeneralRe: Differences between vb.net and c# Pinmemberdojohansen20-Oct-09 1:53 
GeneralRe: Differences between vb.net and c# PinmemberChris Meech24-Sep-09 10:03 
GeneralRe: Differences between vb.net and c# Pinmemberadgonz25-Sep-09 6:51 
GeneralRe: Differences between vb.net and c# Pinmemberdojohansen20-Oct-09 1:55 
GeneralRe: Differences between vb.net and c# Pinmembercjb11024-Sep-09 22:31 
GeneralRe: Differences between vb.net and c# Pinmemberadgonz24-Sep-09 23:18 
GeneralRe: Differences between vb.net and c# Pinmembercjb11025-Sep-09 6:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 20 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid