Click here to Skip to main content
15,887,343 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: You will be on board if you answer this... Pin
Zabuzamomochi17-Oct-12 22:51
Zabuzamomochi17-Oct-12 22:51 
GeneralRe: You will be on board if you answer this... Pin
Gary Huck18-Oct-12 3:04
Gary Huck18-Oct-12 3:04 
AnswerRe: You will be on board if you answer this... Pin
Brady Kelly17-Oct-12 19:57
Brady Kelly17-Oct-12 19:57 
JokeRe: You will be on board if you answer this... Pin
VallarasuS17-Oct-12 20:14
VallarasuS17-Oct-12 20:14 
GeneralRe: You will be on board if you answer this... Pin
Fabio Franco18-Oct-12 4:08
professionalFabio Franco18-Oct-12 4:08 
GeneralRe: You will be on board if you answer this... Pin
RafagaX18-Oct-12 4:51
professionalRafagaX18-Oct-12 4:51 
JokeRe: You will be on board if you answer this... Pin
SortaCore17-Oct-12 20:00
SortaCore17-Oct-12 20:00 
AnswerRe: You will be on board if you answer this... PinPopular
«_Superman_»17-Oct-12 20:23
professional«_Superman_»17-Oct-12 20:23 
DLL not having the main method is not the right answer.

In Windows, EXEs and DLLs have the same format which is the PE (Portable Executable) format.

The PE format has a header called the optional header which records the address of the entry point.
Both EXEs and DLLs can have an entry point.

In fact DLLs do have a default entry point called DllMain.
The only difference here is that, this entry point is optional for DLLs unlike that for an EXE.

As for a DLL having multiple entry points, an EXE can also do this the same way a DLL does, by exporting them.
And an external program can call into these exported entry points the same way it does for a DLL, using LoadLibrary and GetProcAddress.

So the real difference is in a bit in one of the PE headers which states whether the image is a DLL or not, which the loader checks before executing the image.
«_Superman 
I love work. It gives me something to do between weekends.


Microsoft MVP (Visual C++) (October 2009 - September 2013)

Polymorphism in C

AnswerRe: You will be on board if you answer this... Pin
Gennady Oster17-Oct-12 21:15
Gennady Oster17-Oct-12 21:15 
AnswerRe: You will be on board if you answer this... Pin
Magnamus18-Oct-12 0:35
Magnamus18-Oct-12 0:35 
AnswerRe: You will be on board if you answer this... Pin
Florin Jurcovici18-Oct-12 2:14
Florin Jurcovici18-Oct-12 2:14 
AnswerRe: You will be on board if you answer this... PinPopular
ClockMeister18-Oct-12 3:03
professionalClockMeister18-Oct-12 3:03 
GeneralRe: You will be on board if you answer this... Pin
Steve Naidamast18-Oct-12 3:32
professionalSteve Naidamast18-Oct-12 3:32 
GeneralRe: You will be on board if you answer this... Pin
ClockMeister18-Oct-12 4:04
professionalClockMeister18-Oct-12 4:04 
AnswerRe: You will be on board if you answer this... Pin
RafagaX18-Oct-12 4:59
professionalRafagaX18-Oct-12 4:59 
AnswerRe: You will be on board if you answer this... Pin
Member 315299818-Oct-12 10:50
Member 315299818-Oct-12 10:50 
AnswerRe: You will be on board if you answer this... Pin
Naoya Yamaguchi18-Oct-12 11:49
Naoya Yamaguchi18-Oct-12 11:49 
GeneralRe: You will be on board if you answer this... Pin
Chad3F22-Oct-12 19:16
Chad3F22-Oct-12 19:16 
GeneralRe: You will be on board if you answer this... Pin
Naoya Yamaguchi23-Oct-12 11:57
Naoya Yamaguchi23-Oct-12 11:57 
GeneralRe: You will be on board if you answer this... Pin
Chad3F23-Oct-12 13:23
Chad3F23-Oct-12 13:23 
AnswerRe: You will be on board if you answer this... Pin
KP Lee21-Oct-12 22:02
KP Lee21-Oct-12 22:02 
AnswerRe: You will be on board if you answer this... Pin
Chad3F22-Oct-12 19:08
Chad3F22-Oct-12 19:08 
AnswerRe: You will be on board if you answer this... Pin
Jörgen Sigvardsson24-Nov-12 5:38
Jörgen Sigvardsson24-Nov-12 5:38 
JokeNew Exception Type. PinPopular
fjdiewornncalwe15-Oct-12 7:48
professionalfjdiewornncalwe15-Oct-12 7:48 
GeneralRe: New Exception Type. PinPopular
OriginalGriff15-Oct-12 8:15
mveOriginalGriff15-Oct-12 8:15 

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.