Sign in to follow this  
Followers 0
darkjohn20

DLL Call freezing program

6 posts in this topic

Hi, I am using Windows 7, and I have a dll with MultiThreaded support (not for AutoIt) that I am trying to call a function from.

I use:

$Dll = DllOpen("DLL.dll")
$Start = DllCall($Dll, "int", "Start", "int", "1", "int", "1")
MsgBox(0, "Start:", $Start)

Where the function is

int Start(int Instances, int Threads)

When the Dll is called, the program freezes. The only way I can figure this is that MsgBox is never called. No message comes up at all. The script freezes and a "Windows Error Reporting" process is created (yet nothing actually shows up).

I have the dll in the same location as the script, and I have even tried compiling and running the script.

Any ideas what to do/can it be fixed/give up now?

Any more info needed can be provided.

Share this post


Link to post
Share on other sites



It's impossible to say without the file, but do try different calling method (that would be cdecl).


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

trance, adding cdecl stops the freezing, but the call now returns nothing. not an int, not a string, nothing.

From the header:

int mnStart(int Number_of_instances, int Number_of_threads);

My line:

$Start = DllCall($DLL, "int:cdecl", "mnStart", "int", "1", "int", "0")

$DLL returns a "1" when opened, so it's opening. Any more ideas? The Dll isn't mine and I cannot reproduce it or anything.

Share this post


Link to post
Share on other sites

How do you access the $Start variable? It should be an array type when the function succeeds.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

DllCall() returns an array on success.

Check $Start[0]

edit:

Authenticity was faster.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Thank you very much. Even if it doesn't work (the DLL that is), it at least returns something.

Thanks again!

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