The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: RedXVII on April 17, 2006, 09:54:33 AM

Title: Libraries
Post by: RedXVII on April 17, 2006, 09:54:33 AM
Ok, so someone has a .dll and a .lib. Now i write a piece of code using one of the functions from the dll. I include the library and it compiles fine; it uses the dll to run ok and good. But i hear theres a way of incorporating the function in your main exe so that it doesnt need the .dll kicking around in order to run. How does one go about using this, and how would i do this for other people if i made a library. Is it a special assembling/linkining parameter?

Cheers  :U
Title: Re: Libraries
Post by: Vortex on April 17, 2006, 10:04:11 AM
Maybe, you could embed your DLL to your executable :

Loading and running EXEs and DLLs from memory
http://www.masmforum.com/simple/index.php?topic=3150.0
Title: Re: Libraries
Post by: hutch-- on April 17, 2006, 11:14:55 AM
Red,

A DLL differs from an EXE only in that it does not have a starting point like an EXE file. A DLL is designed to be called by either an EXE file or from another DLL and it provides the function within the original memory space of the caller.

A STATIC library is different, it cannot run by itself or be called by a seperate EXE program, it is in fact an available component that you can use to build either an EXE or DLL file. If you bother to look at how the masm32 library is constructed, you will see that the components are just procedures, not executable code and while a DLL can be called at RUNTIME, a STATIC library can only be included at assembly time.
Title: Re: Libraries
Post by: PBrennick on April 19, 2006, 08:00:34 PM
In an install program I am working on, I do the following...
601     RCDATA  DISCARDABLE Res\unrar.dll

Paul