Sign in to follow this  
Followers 0
shanet

<SOLVED> Stupid question about .DLLs?

14 posts in this topic

#1 ·  Posted (edited)

Hey guys,

Sorry to ask such a stupid question, but I really need to know as I am learning C++ (I am still doing basic programs at the moment).

I know that a DLL is a Dynamic Link Library, however what are they actually used for, what is put in them and if you can give any links on really good explanations on how they are made, it would be really appreciated.

Thanks all,

sorry again for the stupid question

shanet

Edited by shanet

[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites



Reading this http://en.wikipedia.org/wiki/Dynamic-link_library should answer those questions.


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

I've been building web base applications in asp.net with VB for a little while. I learn by doing and because of it, I don't have a.

Share this post


Link to post
Share on other sites

I've been building web base applications in asp.net with VB for a little while. I learn by doing and because of it, I don't have a.

A dll is basically a library of functions that can be called from another program. To make one look for the option to compile to a dll in your C++ IDE/Editor of choice.


HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

Thanks. So the equivalent is like a UDF here?


[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites

Thanks FuryCell, I can now change this thread to solved.

shanet


[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites

Thanks. So the equivalent is like a UDF here?

Not exactly. A dll is different from an UDF. The main difference is that a dll is a compiled bunch of code, which you usually don't know the source code that created it. Therefore it is hard to know what is inside the dll - what it does, what it's for, unless you have something like a standard/agreement between the dll library and the one using the library. This is called the calling convention: How you call the functions that are inside the dll. An UDF is more simpler because the source code is the same as the part you're using; There is no need for a calling convention. The equivalent of an AutoIt UDF is in C++ an include, there is no equivalent in AutoIt for a dll.

Share this post


Link to post
Share on other sites

Thinking about it though, Dlls contain UDFs. User defined functions.

Share this post


Link to post
Share on other sites

Technically the dll still needs a main function.

Share this post


Link to post
Share on other sites

Just look at it this way, both UDF's and DLL contain code, the big difference is that you can load the DLL in your program anytime you wish during the runtime of the program(example:click button in your gui that loads DLL then uses some useful function it contains!

Unlike DLL udf files need to link/build in your exe/au3 during code compile time, so when your code compilation is complete you CANT just say (ex: ok now when i press this button) it will load my UDF, so DLL files give you alot of flexibility how and when to use your code.

For example you can give api to people and they can use that api to build plugins for your awesome program, and they would make what when building those plugins? You guess it, they would make DLL, So, they could make the plugins or if you want to call it extended functionality for your code and ýou wouldnt need to compile it! unlike is the case with UDF, all your users need is to load it in your program, of course you first need to instruct the program how to manage that, but thats another subject :x

It might be confusing at first but hopefully this sheds some light on the subject.

Share this post


Link to post
Share on other sites

Marko29, thats all fine and dandy. Except plugins can be implemented as executables. They just dont live inside the address space of the host application. Second, DLLs can be statically linked which means they become essentially built in and must exist before the app will start. This makes statically linked DLLs very much like UDFs. Lastly it wouldn't take too much effort to write a library that loads UDF libraries dynamically. It just requires a bit of thinking and some IPC.

In short, your points miss the mark because you are taking a very narrow view of the possibilities.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Consider that AU3 file with UDFs can be also compiled into A3X format (just compiled code without interpreter).

I'm not much familiar with A3X but In this way it's very similar concept to DLLs

of course except DLLs use native compiled code and A3X use interpreted (bytecode) code.

Edited by Zedna

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0