Pages

Thursday, March 31, 2011

Differences between .EXE and .DLL files

Differences between .EXE and .DLL files

EXE..
1.Its a executable file
2.There is only single main entry
3.When a system launches new exe, a new process is created
4.The entry thread is called in context of main thread of that process.
5.exe runs on its own

DLL..
1.Its a Dynamic Link Library
2.There are many entry points.
3.The system loads a DLL into the context of an existing thread
4. dll file is linked or referenced to the exe at run time.

What is the difference between a DLL and an EXE?

In .NET, an assembly may become a DLL or an EXE. Yet, there is a major underlying difference between the two.

An EXE is an executable file, that may run on its own. Its independant. Where as a DLL is a Dynamic Link Library, that binds to an exe, or another DLL at runtime.

A DLL has an exposed interface, through which members of the assembly may be accessed by those objects that require it.

A DLL runs in tandem with the application space in memory, as the application
references it. Whereas an EXE is independant, and runs as an independant process.

System.Diagnostics.Process.Start(@"C:\Program Files\Some Folder\MyProgram.exe");

No comments:

Post a Comment