News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Been reading about dlls

Started by Magnum, January 28, 2013, 12:13:56 PM

Previous topic - Next topic

Magnum

I see lots of dlls in XP and starting wondering about the advantages and disadvantages of dlls.

When should writing a dll be considered ?

If I understand some of the info below, an update can be made for a program by replacing a module like a dll with an updated one.

I am guessing that there are times when you can use a system dll if it contains functions that you can use ?

Andy


A DLL is a library that contains code and data that can be used by more than one program at the same time. For example, in Windows operating systems, the Comdlg32 DLL performs common dialog box related functions. Therefore, each program can use the functionality that is contained in this DLL to implement an Open dialog box. This helps promote code reuse and efficient memory usage.

By using a DLL, a program can be modularized into separate components. For example, an accounting program may be sold by module. Each module can be loaded into the main program at run time if that module is installed. Because the modules are separate, the load time of the program is faster, and a module is only loaded when that functionality is requested.

Additionally, updates are easier to apply to each module without affecting other parts of the program. For example, you may have a payroll program, and the tax rates change each year. When these changes are isolated to a DLL, you can apply an update without needing to build or install the whole program again.
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

dedndave

we use them all the time
most of the libraries that you include in your program have associated system DLL's
kernel32, user32, shell32, etc - they all have DLL's in windows\system32
masm32.lib and msvcrt are a little different, however

not all DLL's are referenced the same way, though
some, like ones you may author, must be loaded first

Tedd

Use a DLL when you have functions/resources that are to be shared by multiple programs.
If you put the shared functionality in the DLL then it doesn't need to be duplicated in each of the separate programs.
It can also save on physical memory usage as the DLL is only loaded once, but can be mapped into the memory space of each process that uses it.
Potato2

dedndave

QuoteIt can also save on physical memory usage as the DLL is only loaded once,
but can be mapped into the memory space of each process that uses it.

ahhhh - nice to know   :biggrin:

Tomato3

jj2007

Quote from: Tedd on January 29, 2013, 01:30:40 AMIt can also save on physical memory usage as the DLL is only loaded once, but can be mapped into the memory space of each process that uses it.

How does the OS handle DLL-internal data if they share physical memory with other processes?

qWord

Quote from: jj2007 on January 29, 2013, 01:46:07 AM
How does the OS handle DLL-internal data if they share physical memory with other processes?
only the sections with read-only access are shared. Also, if you request write access to such page (Virtual* functions), window will create a private copy in your process. (they call this copy-on-write protection)
MREAL macros - when you need floating point arithmetic while assembling!

Magnum

What about this situation.

A company uses a dll called stop_ie_from_irritating_upgrade_messages.DLL

They write a new dll with different name and install it.

Do they delete the old dll ?

If they don't, is it just taking up space ?

Are there unneeded registry entries when it is no longer being used ?

I occasionally look around my registry.

It looks like that belt around the Earth where all the space debris is floating around.

Andy



Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

jj2007

Quote from: qWord on January 29, 2013, 01:55:16 AM
only the sections with read-only access are shared. Also, if you request write access to such page (Virtual* functions), window will create a private copy in your process. (they call this copy-on-write protection)

Danke :t

Magnum

Thanks Tedd.

I will look for a simple example.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org