flat assembler
Message board for the users of flat assembler.

Index > Windows > newbie question

Author
Thread Post new topic Reply to topic
whatsup



Joined: 01 Feb 2010
Posts: 8
whatsup 01 Feb 2010, 16:07
1. what does it mean import library,
does the compiler add/link my program to a code which will load the library i use ?
or does the OS do that, by lookink in the header of the EXE file ?

2. when i call to a function in dll, say MessageBox, does the OS load this dll for every program, put it in memory location, and then every app can use it ?
or does it loaded only once, for each app, (when the app terminate, the dll unloaded) ?
Post 01 Feb 2010, 16:07
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 01 Feb 2010, 18:06
whatsup wrote:
1. what does it mean import library,
does the compiler add/link my program to a code which will load the library i use ?
or does the OS do that, by lookink in the header of the EXE file ?
I think you're referring to "import table"? It's a format used to say which functions to import from which .dlls (that export such functions obviously) in the .exe -- the Windows Loader then replaces the data there with addresses to such functions, and then executes the program.

whatsup wrote:
or does it loaded only once, for each app, (when the app terminate, the dll unloaded) ?
That was the whole initial point of .dlls, so yeah. They are loaded only once, and everytime a new program loads it, a counter increments saying how many use the .dll -- when the counter becomes 0, the .dll is unloaded (no apps use it anymore).

_________________
Previously known as The_Grey_Beast
Post 01 Feb 2010, 18:06
View user's profile Send private message Reply with quote
whatsup



Joined: 01 Feb 2010
Posts: 8
whatsup 01 Feb 2010, 22:02
thank you very much, you got me understand that, much better now.
Post 01 Feb 2010, 22:02
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.