Sign in to follow this  
Followers 0
AMonari

AutoIt - DllOpen() not opening a present .dll file i.e. it is returning -1

6 posts in this topic

I'm attempting to open a .dll file which is present in my filepath through an AutoIt program I have converted to an exe using Aut2Exe.

When I convert the program to a .exe file, I'm unable to open file as DllOpen() returns a -1 but when I run it SciTE Script Editor it works fine i.e. it is is able to open the .dll file.

The manner in which I've used the DllOpen can be found on this link i.e. GistHub specifically in function _CommSetPort.

Any ideas as to why the function DllOpen when the program is a .exe file would be returning -1 as its return value when clearly the .dll fine it is asked to open is available.

Any ideas/suggestions are appreciated.

Share this post


Link to post
Share on other sites



When you say "present in my filepath" do you mean that both the exe and dll are in the same directory?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Richard Robertson: yes the exe and dll are in the same file path.

Edited by AMonari

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@AMonari,

Do you want to have the dialog here or at StackOverflow?

If you want it here then please post all the relevant info here and we don't have to swap between many different websites.

Items to check:

FileInstall works differently when run via Autoit3.exe or compiled. When run with autoit3 it will perform a filecopy.

Are you compiling with the same version as running, also x86 or x64?

How to you shell the compiled version? When shelling in SciTE, the Workdir will be the scriptdir, so what is it when you shell the compiled version?

Jos

Edited by Jos
1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Oh yes, Jos brings up an excellent question. The bitness of your compiled script and dll must match. 32 bit exe calls 32 bit dll, and 64 bit exe calls 64 bit dll.

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