Art Posted July 29, 2010 Share Posted July 29, 2010 I have a dll function in C: extern "C" __declspec(dllexport) int SI_AddExtDisplayToDesktop(int width, int height) This function works correctly when called from a C program. When I call this dll function in AutoIt v3 with: $result = DllCall ( "siextdispctrl.dll", "int", "SI_AddExtDisplayToDesktop" , "int", 800 , "int", 600 ) the function SI_AddExtDisplayToDesktop function works correctly but I also get the system error message about the app generating an error and needing to close. When I call this function with: $result = DllCall ( "siextdispctrl.dll", "int:cdecl", "SI_AddExtDisplayToDesktop" , "int", 800 , "int", 600 ) there is no system error and the function operates correctly but the return code is illogical. Any ideas on what the problem is? What is the correct way to call this dll function. Thanks, Art Link to comment Share on other sites More sharing options...
MvGulik Posted July 29, 2010 Share Posted July 29, 2010 ... but the return code is illogical.What are you expecting as return code.And what is the actual returned data. (probably a array.) "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 ... Link to comment Share on other sites More sharing options...
Art Posted July 30, 2010 Author Share Posted July 30, 2010 Problem solved. The return from the dll call is actually an array with the first element as the actual return from the function. I just needed to read the docs. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now