The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > The ProgrammersTalk > General Talk


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags: ,

Reply
 
LinkBack Thread Tools    Display Modes   
  #1 (permalink)  
Old 07-21-2007, 12:26 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,109
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
Icon8 What's DLL files are?

Anybody knows what are they really are? I'm just wondering because at that time when I did C#, I had to compile it and get the DLL files. But I have no clue what are those. They used it to test the program or something..

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #2 (permalink)  
Old 07-21-2007, 12:50 AM
chrishirst chrishirst is offline
Jr. Programmer
Join Date: Jun 2007
Location: Blackpool UK
Posts: 87
iTrader: (0)
chrishirst will become famous soon enoughchrishirst will become famous soon enough
DLL files are Dynamic Link Library files.

Basically they are exectuables that get called into existence whenever the functions or methods are required. It works in the same way that classes can be used in VbScript, Java, javascript, PHP etc.

The advantage is these functions and properties do not have to be loaded into memory on program start. They can be loaded and unloaded as and when required.
This will reduce the memory footprint of the application

__________________
Chris
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to chrishirst For This Useful Post:
HelloWorld (07-21-2007)
  #3 (permalink)  
Old 07-21-2007, 01:26 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,109
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
Quote:
The advantage is these functions and properties do not have to be loaded into memory on program start. They can be loaded and unloaded as and when required.
This will reduce the memory footprint of the application
Sorry, I don't understand what do you mean by function? I personally never execute DLL files, how do you execute and test them?

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #4 (permalink)  
Old 07-21-2007, 03:30 AM
chrishirst chrishirst is offline
Jr. Programmer
Join Date: Jun 2007
Location: Blackpool UK
Posts: 87
iTrader: (0)
chrishirst will become famous soon enoughchrishirst will become famous soon enough
Quote:
I personally never execute DLL files
Yes you do
Ever called a predefined function for a windows app from an IDE?

Used a function such as Left(), Right(), Mid(), Time(), Now() , read or written a windows property Screen.Height, App.Path. Displayed a value with MsgBox() in your code?

These all come from DLLs

If you code anything in .net for web use it gets compiled into a DLL by the server.

DLL are coded in the same way that a class would be and they inherit nothing from the calling app.

Testing will depend on what your IDE is capable of. Some will allow for inprocess DLL debugging, where the debugger can enter the code that is run in the DLL, others won't.
One method of testing is to initially set the code for the DLL to run a part of the main application and test thoroughly then convert it into a library and test again.

Personally I often build apps using DLLs both ActiveX and real ones

I have a library of functions that I have built up over the years and include these into my apps with DLLs.

__________________
Chris
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to chrishirst For This Useful Post:
HelloWorld (07-21-2007)
  #5 (permalink)  
Old 07-21-2007, 08:53 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,109
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
Quote:
One method of testing is to initially set the code for the DLL to run a part of the main application and test thoroughly then convert it into a library and test again.
Thanx chrishirst
What do you mean by this? Sorry, I don't really understand XD
I used to use NUnit if you know? And they gave me other part of the codes where it will test the result of my code (bunch of try and catch). I really want to know what's behind this though..

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #6 (permalink)  
Old 07-21-2007, 04:48 PM
rpgfan3233 rpgfan3233 is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jul 2007
Posts: 118
iTrader: (0)
rpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura about
DLLs in Windows are basically the equivalent of "shared objects" (.so files/libraries) on Linux. The idea is that you can store functions in a shared library rather than a static library. The reason why the idea is there is due to the fact that whatever is needed from a static library (.lib on Windows, .a on Linux) is linked into the executable/binary itself. This could mean that if you use a lot of functions from that library, you may end up with a large executable/binary as well as a large memory hog for a program.

If you link against a shared library however, that library is loaded into memory whenever it is needed after which the memory is freed (ideally). This results in smaller executable/binary as well as less memory usage. For an example, I just recently tried the D programming language again using the Digital Mars D compiler (dmd-1.018 to be exact). The minimalistic code:
Code:
void main () { }
resulted in a 75 KB executable on Windows. This is due to the fact that the phobos library (a single library is the power behind the D programming language...) is simply a static library (phobos.lib). No matter what optimizations I did or did not include, I could not shrink it down. The D frontend to gcc (dgcc) was even larger. Since I use gcc on Windows (via MinGW) I also use the strip utility (strip.exe on Windows) to strip unnecessary symbols from the executable. However, dmd compiles to OMF format (Microsoft once used it but dropped it in favor of COFF), which strip.exe doesn't understand. As a result, that filesize and somewhat unnecessary memory usage are simple facts that must be dealt with. I posted about the issue on their newsgroups, and the UPX packing utility was recommended. However, that results in a smaller executable at the expense of more memory usage.

Simple point: shared > static (DLL > LIB, or so > a) in a lot of cases.

__________________
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off."
-- Bjarne Stroustrup, creator of what is now known as C++
For more quotes by Bjarne Stroustrup, check out http://www.research.att.com/~bs/bs_faq.html#really-say-that.
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to rpgfan3233 For This Useful Post:
HelloWorld (07-21-2007)
  #7 (permalink)  
Old 07-21-2007, 06:28 PM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,109
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
But isn't library also consist of bunch of functions, even more, it will also consist of bunch of classes.. (my graduate friend told me that's it's like a JAR file in Java) how can that takes less memory?

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #8 (permalink)  
Old 07-21-2007, 06:42 PM
rpgfan3233 rpgfan3233 is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jul 2007
Posts: 118
iTrader: (0)
rpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura about
Quote:
Originally Posted by HelloWorld View Post
But isn't library also consist of bunch of functions, even more, it will also consist of bunch of classes.. (my graduate friend told me that's it's like a JAR file in Java) how can that takes less memory?
It takes less memory because it is loaded during runtime as needed, then unloaded when it is no longer needed. Rather than having something like a 100K program in memory the entire time, you could link against a DLL and only have a little bit at a time.

__________________
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off."
-- Bjarne Stroustrup, creator of what is now known as C++
For more quotes by Bjarne Stroustrup, check out http://www.research.att.com/~bs/bs_faq.html#really-say-that.
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to rpgfan3233 For This Useful Post:
HelloWorld (07-21-2007)
  #9 (permalink)  
Old 07-21-2007, 06:42 PM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 615
iTrader: (0)
Lee will become famous soon enoughLee will become famous soon enoughLee will become famous soon enoughLee will become famous soon enough
I think what hes saying is it only calls the functions to memory as it needs rather than the program having the functions in it already, if it had the functions in the .exe rather than the .dll then it would be taking up more memory.
Reply With Quote
The Following User Says Thank You to Lee For This Useful Post:
HelloWorld (07-21-2007)
  #10 (permalink)  
Old 07-21-2007, 07:40 PM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,109
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
Thanx rpgfan3233 & Lee
I really understand it now

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

   Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 05:00 PM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50