Click here to Skip to main content
15,888,461 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: personal worst... Pin
Chris Maunder19-Nov-18 8:08
cofounderChris Maunder19-Nov-18 8:08 
GeneralRe: personal worst... Pin
GenJerDan19-Nov-18 20:34
GenJerDan19-Nov-18 20:34 
GeneralRe: personal worst... Pin
Herman<T>.Instance21-Nov-18 22:23
Herman<T>.Instance21-Nov-18 22:23 
GeneralRe: personal worst... Pin
DerekT-P21-Nov-18 23:09
professionalDerekT-P21-Nov-18 23:09 
GeneralRe: personal worst... Pin
Nelek22-Nov-18 9:48
protectorNelek22-Nov-18 9:48 
GeneralRe: personal worst... Pin
TheGreatAndPowerfulOz14-Jan-19 2:57
TheGreatAndPowerfulOz14-Jan-19 2:57 
GeneralRe: personal worst... Pin
David A. Gray28-Apr-19 15:49
David A. Gray28-Apr-19 15:49 
GeneralMS, you funny! Pin
David O'Neil10-Nov-18 13:18
professionalDavid O'Neil10-Nov-18 13:18 
Poking around, MS doesn't want you to use GetSaveFileName anymore. Instead, they want you to use the 'Common Item Dialog'. So click on that page, and find a function with 11 indentation levels! Copy and paste it, to find that it is part of a sample code, and relies on other functions in that sample. Try to download the sample, and the page isn't found. But you can download an SDK which supposedly contains the sample? Try to run it, though, and you will get a 'Some components cannot be installed' error, and no indication that the samples are included in it. Dead | X| Oh MS, you funny!

All this because I was trying to figure out a way to allow the user to save program configuration files in the user app work directory, and regular files wherever they wish, but MS, in their infinite non-wisdom, won't allow the directory to be changed using GetSaveFileName, because they believe you will only ever be dealing with one type of file for your application. D'Oh! | :doh:

(Of course, they have the same issue in MS Word, and other Office programs, because they store config files like macros in a special subdirectory until the user changes where they store them. Afterwards, the dialog will default to that special directory until after you change it once. At least that was the case the last time I played with macros in Word.) Double- D'Oh! | :doh:

GeneralRe: MS, you funny! Pin
Marc Clifton10-Nov-18 13:50
mvaMarc Clifton10-Nov-18 13:50 
GeneralRe: MS, you funny! Pin
David O'Neil10-Nov-18 14:37
professionalDavid O'Neil10-Nov-18 14:37 
GeneralRe: MS, you funny! Pin
Jon McKee10-Nov-18 16:02
professionalJon McKee10-Nov-18 16:02 
GeneralRe: MS, you funny! Pin
David O'Neil11-Nov-18 8:06
professionalDavid O'Neil11-Nov-18 8:06 
GeneralRe: MS, you funny! Pin
RickZeeland12-Nov-18 6:38
mveRickZeeland12-Nov-18 6:38 
GeneralRe: MS, you funny! Pin
David O'Neil12-Nov-18 7:06
professionalDavid O'Neil12-Nov-18 7:06 
GeneralRe: MS, you funny! Pin
RickZeeland12-Nov-18 7:42
mveRickZeeland12-Nov-18 7:42 
GeneralRe: MS, you funny! Pin
David O'Neil12-Nov-18 8:50
professionalDavid O'Neil12-Nov-18 8:50 
AnswerRe: MS, you funny! Pin
RickZeeland12-Nov-18 20:17
mveRickZeeland12-Nov-18 20:17 
GeneralRe: MS, you funny! Pin
David O'Neil13-Nov-18 6:23
professionalDavid O'Neil13-Nov-18 6:23 
JokeRe: MS, you funny! Pin
Nelek11-Nov-18 2:48
protectorNelek11-Nov-18 2:48 
GeneralRe: MS, you funny! Pin
David O'Neil11-Nov-18 8:05
professionalDavid O'Neil11-Nov-18 8:05 
GeneralRe: MS, you funny! Pin
Dirk Bahle12-Nov-18 10:52
Dirk Bahle12-Nov-18 10:52 
GeneralRe: MS, you funny! Pin
Bernhard Hiller13-Nov-18 22:19
Bernhard Hiller13-Nov-18 22:19 
GeneralThis code is evil Pin
den2k887-Nov-18 4:18
professionalden2k887-Nov-18 4:18 
GeneralRe: This code is evil PinPopular
Pete O'Hanlon7-Nov-18 6:21
mvePete O'Hanlon7-Nov-18 6:21 
GeneralRe: This code is evil Pin
MarkTJohnson7-Nov-18 6:43
professionalMarkTJohnson7-Nov-18 6:43 

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.