Click here to Skip to main content
15,888,521 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Why Microsoft Disgusts Me Today Pin
Dar Brett13-Mar-19 16:25
Dar Brett13-Mar-19 16:25 
GeneralRe: Why Microsoft Disgusts Me Today Pin
#realJSOP19-Mar-19 9:34
mve#realJSOP19-Mar-19 9:34 
GeneralRe: Why Microsoft Disgusts Me Today Pin
Rick York19-Mar-19 13:11
mveRick York19-Mar-19 13:11 
GeneralRe: Why Microsoft Disgusts Me Today Pin
Dave Kreskowiak22-Mar-19 4:07
mveDave Kreskowiak22-Mar-19 4:07 
GeneralRe: Why Microsoft Disgusts Me Today Pin
MacSpudster26-Mar-19 10:50
professionalMacSpudster26-Mar-19 10:50 
GeneralRe: Why Microsoft Disgusts Me Today Pin
abmv8-Apr-19 21:38
professionalabmv8-Apr-19 21:38 
GeneralRe: Why Microsoft Disgusts Me Today Pin
Rick York9-Apr-19 5:20
mveRick York9-Apr-19 5:20 
General#define Macros and the Preprocessor Used by the Resource Compiler Pin
David A. Gray10-Mar-19 10:38
David A. Gray10-Mar-19 10:38 
Today, I encountered a problem that appeared to suggest that stringizing behaves differently when headers are fed to the Win32 Resource Compiler, rc.exe. My research led me to a post by Raymond Chen, The Resource Compiler’s preprocessor is not the same as the C preprocessor – The Old New Thing, which included the following comment posted by laonianren at October 5, 2017 at 5:26 am:
Stringizing can be persuaded to work in rc files. This converts version numbers into a dotted string suitable for the text part of a version resource:
C++
#define STRINGIZE(x) #x
    #define EXPAND(x) STRINGIZE(x)
    #define MAJOR_VERSION 10
    #define MINOR_VERSION 0
    #define RELEASE_NUMBER 14393
    #define BUILD_NUMBER 0
    #define DOTTED_VERSION EXPAND(MAJOR_VERSION) "." EXPAND(MINOR_VERSION) "." EXPAND(RELEASE_NUMBER) "." EXPAND(BUILD_NUMBER)

I ultimately discovered that the workaround described above is not only no longer needed, but actually won't work, because the EXPAND directive used therein is no longer recognized. With the current tools, you can do this.
C++
#define VER_DESCRIPTION_AND_PLATFORM    VER_FILE_DESCRIPTION VER_PLATFORM

Though this improvement may be buried in a changelog, it's just as likely that it was quietly fixed, but never reported.

The bottom line is that it opens some very cool possibilities, such as incorporating variable text that depends on preprocessor values in standard version resources.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting

GeneralRe: #define Macros and the Preprocessor Used by the Resource Compiler Pin
Rick York12-Mar-19 10:56
mveRick York12-Mar-19 10:56 
GeneralRe: #define Macros and the Preprocessor Used by the Resource Compiler Pin
Dr.Walt Fair, PE13-Mar-19 6:27
professionalDr.Walt Fair, PE13-Mar-19 6:27 
GeneralExtending Generics with nested types Pin
raddevus4-Mar-19 10:30
mvaraddevus4-Mar-19 10:30 
GeneralRe: Extending Generics with nested types Pin
Nathan Minier5-Mar-19 2:17
professionalNathan Minier5-Mar-19 2:17 
GeneralRe: Extending Generics with nested types Pin
raddevus5-Mar-19 2:33
mvaraddevus5-Mar-19 2:33 
GeneralRe: Extending Generics with nested types Pin
Dr.Walt Fair, PE13-Mar-19 6:28
professionalDr.Walt Fair, PE13-Mar-19 6:28 
GeneralRe: Extending Generics with nested types Pin
raddevus13-Mar-19 7:30
mvaraddevus13-Mar-19 7:30 
GeneralRe: Extending Generics with nested types Pin
Dr.Walt Fair, PE7-May-19 5:50
professionalDr.Walt Fair, PE7-May-19 5:50 
GeneralDocumentation boggle of the day PinPopular
Gary Wheeler6-Feb-19 8:22
Gary Wheeler6-Feb-19 8:22 
GeneralRe: Documentation boggle of the day Pin
MarkTJohnson6-Feb-19 8:37
professionalMarkTJohnson6-Feb-19 8:37 
GeneralRe: Documentation boggle of the day Pin
Ron Anders6-Feb-19 10:20
Ron Anders6-Feb-19 10:20 
GeneralRe: Documentation boggle of the day Pin
User 592416-Feb-19 12:53
User 592416-Feb-19 12:53 
GeneralRe: Documentation boggle of the day Pin
Jörgen Andersson6-Feb-19 18:08
professionalJörgen Andersson6-Feb-19 18:08 
GeneralRe: Documentation boggle of the day Pin
User 592416-Feb-19 18:24
User 592416-Feb-19 18:24 
GeneralRe: Documentation boggle of the day Pin
Jörgen Andersson6-Feb-19 19:52
professionalJörgen Andersson6-Feb-19 19:52 
GeneralRe: Documentation boggle of the day Pin
Kirk 103898217-Feb-19 2:56
Kirk 103898217-Feb-19 2:56 
GeneralRe: Documentation boggle of the day Pin
David O'Neil6-Feb-19 17:20
professionalDavid O'Neil6-Feb-19 17:20 

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.