|
This document and the software it describes may not be reproduced, in whole or in part, in any form whatsoever without the written permission of SunGard.
I reproduced a part of the website on my screen, using a browser, by clicking the link.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
The FBI will be visiting you this afternoon.
|
|
|
|
|
|
Hi there, the link is broken ( could they be embarrassed ? )
|
|
|
|
|
Weird... It seems to be working for me as of right now.
|
|
|
|
|
Still down for me , get a 404 error - weird !!
|
|
|
|
|
+5 for the use of the word 'Egregious'!
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image.
Stephen Hawking
|
|
|
|
|
Thanks, it just really seemed to be the best word to sum up my feelings there.
|
|
|
|
|
|
VallarasuS wrote: Wait! What would you answer if such question was fired at you?
Probably the answer they were looking for:
An exe requires a fixed entry point, so the loader can work out where start execution. A dll lacks this entry point and therefore the loader can't work out where to start.
Other than that, I don't think there are any important differences between an exe and dll, though I could be wrong about that.
|
|
|
|
|
DLLs can have standards-specified entry points too, for example the functions used for COM registration/deregistration. But yes, they don't have a 'main method' which is directly linked to from the file header. I think if you went with that answer to such an idiotic question they'd just not get it though.
|
|
|
|
|
DllMain()
[edit]
Oh, and check out the /ENTRY option on the linker too.
We can program with only 1's, but if all you've got are zeros, you've got nothing.
|
|
|
|
|
Wrong forum?
I'd say that those are the operating system rules ... an exe is an executable file and a dll is a library (the clue's in the name).
|
|
|
|
|
BobJanova wrote: Wrong forum?
Have you missed the signature?
It does not have a main method! - the interviewer said!
|
|
|
|
|
Oh, I don't read signatures as part of the post.
|
|
|
|
|
No one does
|
|
|
|
|
I just did
|
|
|
|
|
Yes, not having a main method is a key part of the correct answer to that.
|
|
|
|
|
You may be right, but on the other hand I can compile any code into a dll, so does a "main()" method, but still it won't execute!
|
|
|
|
|
Exactly, the correct term would be a main entry point. The main method is just a label used by compilers to indicate the main entry point of the application.
Plus, there are a few details that are different between DLLs and EXEs like the PE Header.
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
----
Our heads are round so our thoughts can change direction - Francis Picabia
|
|
|
|
|
Yes it will, if you know the magic words (or command).
|
|
|
|
|
They probably saw rundll32.exe and made assumptions...
|
|
|
|
|
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.
|
|
|
|
|
The main difference is that exe runs in it's own address space as the independent process. The DLL works in the address space of the parent process, so the prolog executed during loading is different, and any entry point of the DLL cannot be called directly by OS. Only parent process can load and call DLL. That's why you need regsvr32 hosting exe to use DllRegisterServer "independent" entry point.
Regards,
Gennady
My English is permanently under construction. Be patient !!
|
|
|
|
|
An EXE is an out-of-process executable.
A DLL is an in-process executable.
|
|
|
|