hi friends,
can any body tell me the difference between the dll and exe

Dani AI

Generated

Good baseline from and — the replies already hit the practical difference, so here are a few concrete, developer-focused details and caveats that weren’t covered.

Both EXE and DLL use the same Windows PE format, but they differ in how the OS treats their entry points and how you consume them. A DLL exposes exported symbols and gets a simple initialization callback (DllMain) when it is loaded; keep DllMain tiny and avoid heavy work (no LoadLibrary/GetProcAddress calls, no thread creation, no waiting on sync objects). Example minimal shape:

BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
{
    switch (reason) {
    case DLL_PROCESS_ATTACH: /* light init only */ break;
    case DLL_PROCESS_DETACH: /* cleanup */ break;
    }
    return TRUE;
}

Loading/linking: you can bind to DLLs implicitly (import table) or load them explicitly at runtime with LoadLibrary + GetProcAddress, which is the basis for plugin architectures. If you export C++ symbols you’ll run into name-mangling and ABI fragility across compilers; prefer extern "C" wrappers or a C API boundary, or use COM for binary compatibility. Note that code pages can be shared by the OS between processes, but writable data is per-process (copy-on-write), so global state in a DLL still behaves like per-process state — plan for thread-safety and avoid hidden globals.

For and anyone installing executables: installers don’t require a DLL to run code. In WiX you can execute an EXE as a custom action (embed in the Binary table or run the installed file after InstallFiles), or use Burn to chain packages. Prefer deferred, non-impersonated actions when elevation is needed, and avoid doing critical install work in immediate custom actions. For debugging use verbose MSI logging (msiexec /i package.msi /l*v install.log) to capture return codes and failures.

Recommended Answers

All 8 Replies

A DLL is a collection of code that is shared among several programs. Instead of duplicating that code in every program people put the code in a DLL so that every program can use it. The operating system running on your computer is a very good example -- the installation directory will contain many many DLLs

good info,never bothered to research that

hmm...dll cant execute itself but exe can....

wats the main purpose of dll instead it cant execute itself

hmm...dll cant execute itself but exe can....

wats the main purpose of dll instead it cant execute itself

Ohk id like to answer you ther exe is for sefl extracting of that specific program whereas dll holds files that you that some various programs/system uses when operating

feel free to correct me if im wrong

Hi friend...

Actually the basic difference between these two is as follows....

A DLL (Dynamic Link Library) is so named because it is linked with your ordinalry EXE at run time (i.e. dynamically). So the size of the EXE don't go out of the hand because only necessary functions are referenced at runtime. Thus the DLL contain the set of functions which you may refer as Windows API, they are also stored in DLLs. And these DLLs are reusable.

An EXE is just the Binary form of your application that can be easily executed by our systems. For eg. MSWord...

The other difference is that the DLL runs in the same memory space as the application is running while an EXE runs in its own memory space. So the dll is in process and exe is out of process.

The variables and the functions included in a DLL are generally referenced using relative paths whereas in EXE they are referenced by absolute pathing...

The DLL can't be ran standalone, it is linked to the EXE while the EXE can be ran standalone..

This is the best I could give you..

Thank You...

well said sahil

Thank you sir....

And I kindly requyest you to give reply to this thread if you get any more information about that difference...

Sahil Akhunji

Hi guys m new in the .msi compilation and I'm required to use make an msi that will install the component by executing it. The assembly i have is .exe and how do u execute that using custom actions in wix since i dont have a .dll file to reference as a binary?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.