Click here to Skip to main content
11,484,402 members (65,051 online)

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 Pin
S. Senthil Kumar3-Nov-09 5:48
memberS. Senthil Kumar3-Nov-09 5:48 
GeneralRe: Call Dispose on anything Pin
PIEBALDconsult3-Nov-09 10:09
memberPIEBALDconsult3-Nov-09 10:09 
GeneralRe: Call Dispose on anything Pin
supercat919-Oct-09 11:04
membersupercat919-Oct-09 11:04 
GeneralRe: Call Dispose on anything Pin
PIEBALDconsult19-Oct-09 11:07
memberPIEBALDconsult19-Oct-09 11:07 
GeneralRe: Call Dispose on anything Pin
Gideon Engelberth19-Oct-09 12:34
memberGideon Engelberth19-Oct-09 12:34 
GeneralRe: Call Dispose on anything Pin
supercat919-Oct-09 14:17
membersupercat919-Oct-09 14:17 
GeneralRe: Call Dispose on anything Pin
Gideon Engelberth20-Oct-09 11:20
memberGideon Engelberth20-Oct-09 11:20 
GeneralRe: Call Dispose on anything Pin
supercat920-Oct-09 11:38
membersupercat920-Oct-09 11:38 
GeneralRe: Call Dispose on anything Pin
S. Senthil Kumar2-Nov-09 21:33
memberS. Senthil Kumar2-Nov-09 21:33 
GeneralRe: Call Dispose on anything Pin
Paulo Zemek26-Oct-09 10:13
memberPaulo Zemek26-Oct-09 10:13 
AnswerHow about doing this instead... Pin
Daniel Flower2-Nov-09 2:54
memberDaniel Flower2-Nov-09 2:54 
GeneralRe: How about doing this instead... Pin
PIEBALDconsult2-Nov-09 4:13
memberPIEBALDconsult2-Nov-09 4:13 
General(C++) Trick or Treat ( Make/Expand our tricks.h file) [modified] Pin
Daniel L Kelly12-Oct-09 15:24
memberDaniel L Kelly12-Oct-09 15:24 
GeneralRe: (C++) Trick or Treat ( Make/Expand our tricks.h file) [modified] Pin
Michael Dunn13-Oct-09 9:13
sitebuilderMichael 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) Pin
sashoalm16-Oct-09 22:10
membersashoalm16-Oct-09 22:10 
GeneralRe: (C++) Trick or Treat ( Make/Expand our tricks.h file) Pin
Jörgen Sigvardsson21-Oct-09 7:04
memberJörgen Sigvardsson21-Oct-09 7:04 
GeneralA clever backup... Pin
Rozis12-Oct-09 11:07
memberRozis12-Oct-09 11:07 
GeneralRe: A clever backup... Pin
Dave Kreskowiak12-Oct-09 16:13
mvpDave Kreskowiak12-Oct-09 16:13 
GeneralRe: A clever backup... Pin
Bizit Deb14-Oct-09 21:26
memberBizit Deb14-Oct-09 21:26 
GeneralRe: A clever backup... Pin
Like2Byte18-Oct-09 10:07
memberLike2Byte18-Oct-09 10:07 
GeneralXml Serialization Bug + Control.Invoke Bug (Or: My Adventures In .NET!) [modified] Pin
The_Mega_ZZTer28-Sep-09 16:44
memberThe_Mega_ZZTer28-Sep-09 16:44 
GeneralRe: Xml Serialization Bug + Control.Invoke Bug (Or: My Adventures In .NET!) Pin
BillWoodruff5-Oct-09 5:40
memberBillWoodruff5-Oct-09 5:40 
GeneralDifferences between vb.net and c# Pin
adgonz24-Sep-09 9:25
memberadgonz24-Sep-09 9:25 
GeneralRe: Differences between vb.net and c# [modified] Pin
Luc Pattyn24-Sep-09 9:50
mvpLuc Pattyn24-Sep-09 9:50 
GeneralRe: Differences between vb.net and c# Pin
dojohansen20-Oct-09 1:53
memberdojohansen20-Oct-09 1:53 
GeneralRe: Differences between vb.net and c# Pin
Chris Meech24-Sep-09 10:03
memberChris Meech24-Sep-09 10:03 
GeneralRe: Differences between vb.net and c# Pin
adgonz25-Sep-09 6:51
memberadgonz25-Sep-09 6:51 
GeneralRe: Differences between vb.net and c# Pin
dojohansen20-Oct-09 1:55
memberdojohansen20-Oct-09 1:55 
GeneralRe: Differences between vb.net and c# Pin
cjb11024-Sep-09 22:31
membercjb11024-Sep-09 22:31 
GeneralRe: Differences between vb.net and c# Pin
adgonz24-Sep-09 23:18
memberadgonz24-Sep-09 23:18 
GeneralRe: Differences between vb.net and c# Pin
cjb11025-Sep-09 6:27
membercjb11025-Sep-09 6:27 
GeneralRe: Differences between vb.net and c# Pin
adgonz25-Sep-09 6:54
memberadgonz25-Sep-09 6:54 
GeneralRe: Differences between vb.net and c# Pin
Ian Shlasko25-Sep-09 7:06
memberIan Shlasko25-Sep-09 7:06 
GeneralRe: Differences between vb.net and c# Pin
PIEBALDconsult25-Sep-09 9:13
memberPIEBALDconsult25-Sep-09 9:13 
GeneralRe: Differences between vb.net and c# Pin
Luc Pattyn25-Sep-09 10:50
mvpLuc Pattyn25-Sep-09 10:50 
GeneralRe: Differences between vb.net and c# Pin
adgonz28-Sep-09 1:25
memberadgonz28-Sep-09 1:25 
GeneralRe: Differences between vb.net and c# Pin
Henry Minute26-Sep-09 14:02
memberHenry Minute26-Sep-09 14:02 
GeneralRe: Differences between vb.net and c# Pin
Michael Eber7-Oct-09 14:27
memberMichael Eber7-Oct-09 14:27 
GeneralRe: Differences between vb.net and c# Pin
peterchen12-Oct-09 6:44
memberpeterchen12-Oct-09 6:44 
GeneralRe: Differences between vb.net and c# Pin
Gideon Engelberth29-Sep-09 13:20
memberGideon Engelberth29-Sep-09 13:20 
GeneralRe: Differences between vb.net and c# Pin
Michael Eber7-Oct-09 14:31
memberMichael Eber7-Oct-09 14:31 
GeneralRe: Differences between vb.net and c# Pin
Steven J Jowett11-Oct-09 0:13
memberSteven J Jowett11-Oct-09 0:13 
GeneralRe: Differences between vb.net and c# Pin
Michael Dunn13-Oct-09 9:17
sitebuilderMichael Dunn13-Oct-09 9:17 
GeneralRe: Differences between vb.net and c# Pin
Mauro Leggieri23-Oct-09 2:39
memberMauro Leggieri23-Oct-09 2:39 
GeneralEmbedding Collection Controls (Or Any Object) in the TAG Property of Treeview. [modified] Pin
Nobia4-Sep-09 23:33
memberNobia4-Sep-09 23:33 
GeneralRe: Embedding Collection Controls (Or Any Object) in the TAG Property of Treeview. Pin
PIEBALDconsult5-Sep-09 2:11
memberPIEBALDconsult5-Sep-09 2:11 
GeneralRe: Embedding Collection Controls (Or Any Object) in the TAG Property of Treeview. Pin
daveauld5-Sep-09 2:35
memberdaveauld5-Sep-09 2:35 
GeneralRe: Embedding Collection Controls (Or Any Object) in the TAG Property of Treeview. Pin
livanCreep15-Sep-09 23:29
memberlivanCreep15-Sep-09 23:29 
GeneralRe: Embedding Collection Controls (Or Any Object) in the TAG Property of Treeview. Pin
darkelv21-Sep-09 4:29
memberdarkelv21-Sep-09 4:29 
GeneralRe: Embedding Collection Controls (Or Any Object) in the TAG Property of Treeview. Pin
Adis H.5-Sep-09 4:54
memberAdis H.5-Sep-09 4:54 

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
Web01 | 2.8.150520.1 | Last Updated 25 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid