Jump to content

dll? udf?


corey822
 Share

Recommended Posts

ok hi i see people talking bout dll udf and other suff like that and they include them into there scripts but could someone help me understand this more

wat is dll and udf

and ini files

and what can be included into your script and for wat purpose for example

#include <something.au3 or .udf .dll>

someone clarify please

cheers C.W

Edited by corey822

C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

Link to comment
Share on other sites

Oh dear god.

UDF - (User Defined Functions):

This is just an *.au3 script containing custom functions which build on top of AutoIt functions

DLL - (Dynamic Link Library):

You do not include a dll, but call it. See here: http://en.wikipedia.org/wiki/Library_%28co...Dynamic_linking

INI:

This is a file where key / value pairs can be stored and grouped into sections. See here: http://en.wikipedia.org/wiki/INI_file

This will look in the includes directory below your AutoIt installation:

#include<script.au3>

This will look in the folder where your script resides:

#include "script.au3"

Link to comment
Share on other sites

ok hi i see people talking bout dll udf and other suff like that and they include them into there scripts but could someone help me understand this more

wat is dll and udf

and what can be included into your script and for wat purpose for example

#include <something.au3 or .udf .dll>

someone clarify please

cheers C.W

DLL stands for Dynamic Link Library. It's an executable type of compiled program which has one or more useful function in it. Originally developed so that if a function is often needed by lots of different programs then instead of each program having to include the code for the function each program can just call the dll. So it saves memory.

To call a dll you have to know the functions and the parameters required and what it will return. So it's very much like a UDF in that way. A UDF is a User Defined Funcion, actually UDF's usually have lots of functions just like DLL's often have lots. But when you use a UDF you are including the code in your script so you don't have to write it yourself, it doesn't save any memory and no other programs can use it (from your running script I mean).

If you want to use a listview for example, then it is quite complicated working out how to use it, but if you add #include <GuiLIstView.au3> at the top of your script then this is equivalent to copying all the lines from GuiLIstView.au3 and pasting them where you had the #include line. Then you can use any of the functins without having to write them yourself.

So includes are just adding code to your script.

You cannot 'add' a dll to your script. You have to call it, say with DllOpen, which starts it running as a separate processing in memory, and then you send it the details of the function you want with the parameters using DllCall. The return from DllCall contains the output of the function if it worked.

One of the advantages of a dll is that almost any program can use it no matter what language. I wrote a print dll because I thought it would be useful for people writing AutoIt scripts, but one of the first people to try it used it with php.

An include file is specific to a particular language.

Does that make sense?

EDIT : I write too slowly, weaponex beat me to it a long time ago.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

DLL stands for Dynamic Link Library. It's an executable type of compiled program which has one or more useful function in it. Originally developed so that if a function is often needed by lots of different programs then instead of each program having to include the code for the function each program can just call the dll. So it saves memory.

To call a dll you have to know the functions and the parameters required and what it will return. So it's very much like a UDF in that way. A UDF is a User Defined Funcion, actually UDF's usually have lots of functions just like DLL's often have lots. But when you use a UDF you are including the code in your script so you don't have to write it yourself, it doesn't save any memory and no other programs can use it (from your running script I mean).

If you want to use a listview for example, then it is quite complicated working out how to use it, but if you add #include <GuiLIstView.au3> at the top of your script then this is equivalent to copying all the lines from GuiLIstView.au3 and pasting them where you had the #include line. Then you can use any of the functins without having to write them yourself.

So includes are just adding code to your script.

You cannot 'add' a dll to your script. You have to call it, say with DllOpen, which starts it running as a separate processing in memory, and then you send it the details of the function you want with the parameters using DllCall. The return from DllCall contains the output of the function if it worked.

One of the advantages of a dll is that almost any program can use it no matter what language. I wrote a print dll because I thought it would be useful for people writing AutoIt scripts, but one of the first people to try it used it with php.

An include file is specific to a particular language.

Does that make sense?

EDIT : I write too slowly, weaponex beat me to it a long time ago.

yes opened my mind more but is there any example's laying around that i can have a look at to understand mroe clearly as u learn with ur eyes not ur mind

cheers C.W

C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

Link to comment
Share on other sites

Example include usage:

Script to include ---> genericudf.au3:

Func scramble($S)
    Local $out = ""
    $Array = StringSplit($S, "")
    For $X = 1 to $Array[0]
        $Temp = $Array[$X]
        $Random = Random ( $X, $Array[0], 1)
        $Array[$X] = $Array[$Random]
        $Array[$Random] = $Temp
        $out &= $Array[$X]
    Next
    Return $out
EndFuncoÝ÷ Ùj+)à±Êâ¦Þ¶nl¬r¸©µ«·ý¶®¶­sb6æ6ÇVFRgV÷C¶vVæW&7VFbæS2gV÷C° ¢b33cµ7G&ærÒgV÷Cµ4T5$UG77v÷&BgV÷C°¤×6t&÷ÂgV÷C²gV÷C²Ç67&Ö&ÆRb33cµ7G&ær

This example will take the given string and scramble the letters around using the included function.

Link to comment
Share on other sites

Look in the "C:\Program Files\AutoIt3\Include" folder. There are a whole bunch of .au3 files that are available to be included into your scripts. If you open one of them up... lets pick "IE.au3" you will see that there is a whole boat load of functions in there. By just adding the line #include <IE.au3> you get access to all of those functions without having to make them yourself.

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

By just adding the line #include <IE.au3> you get access to all of those functions without having to make them yourself.

oh ok that put is into understanding thnx everyone

cheers C.W mayb this should be a sticky?

C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...