Jump to content

Understanding dll files, and how to make them


Bert
 Share

Recommended Posts

I'm making a script, and I thought it may be wise to add some dll files to handle some stuff. I could easily make the files EXEs, but I thought it may be better to make them run in dll mode. (Learn something new, and expand my horizons) I've reviewed the helpfile, and I'm somewhat lost on how to

  • make the dll
  • call the dll in my EXE script
  • have the dll file run so it handles some of the sub-routines, and keep my main exe script clear to handle the main stuff.
Any advice would be welcomed.
Link to comment
Share on other sites

You need a language such as C++. I have seen several people using something called Free Basic around here too. Once you choose the language, find the information specific to each language to compile a 32-bit library. It's not terribly complicated but it does speed some things up and clear up the script.

Link to comment
Share on other sites

I myself wanted to do the same thing lately, and I did a LOT of research here on the forums, and elsewhere. The info is here, but it's all in pieces, and took some experiments to figure out. So, to aid myself, I made a sample development project that I could easily and quickly adapt for anything I may need in the future. This is using Bloodshed C++, as I don't quite understand VC++ myself (even though I own a legally bought copy, just haven't gotten around to trying to figure it out with everything else). I figure the .cpp file that this project uses should work just fine with it.

Also included in the zip is a sample .au3 file, showing the calls to the Dll. I didn't include a copy of the dll, but if you want, I can upload it too.

Autoit3_DLL.zip

Link to comment
Share on other sites

ok, I understand that to a point. I'm starting to study C##, so I should be able to figure this out. Next question -

Does a dll need to be compiled in any manor, or is it simply making a file and renaming it?

How does one MAKE a dll? I assume you can use SciTe to edit it.

Link to comment
Share on other sites

Well, in my limited experience (read: I just figured this out last week), .dll's not only need to be compiled, but should be compiled, mainly because you'd lose the speed benefit your looking for if they were interpreted. As for an editor the Bloodshed C++ package I downloaded to make the above package has an IDE itself, which is nice, and the package I chose came with a compiler, so it had everything I needed to make C/C++ programs, and was only around 5-6Mb in size.

I can tell you in the package I included, if you get the IDE, and compile with it, the dll will be compiled in the same directory you extract the files to, and named sample.dll. Look around in the Project settings to see how you can change that, as that is how I usually make new projects: Copy the above files into a new folder, rename a few things, change what name the dll will have, and start building everything in earnest.

Link to comment
Share on other sites

C## is not a language. C++ is a native language, and dlls produced using it can be called by AutoIt. C# is also a language, but it is a .Net managed language and will not export natively callable data.

Like I said before, you need to check your language's documentation on creating dlls. Dlls have a special main function that is called when the dll is loaded, either initially or on a new thread, etc. If you correctly state the language you are using, we can help.

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...