stefythebest Posted December 15, 2006 Posted December 15, 2006 Hello!! I'm a newbie in autoit and i'm trying to make a simple gui with a button to load an image. I have a dll (written in c++ with opencv) which opens an image file from a selected path and i want to call it from my gui. The DllCall returns 0, so it works, but the image can't be displayed (even if in the dll function a window opens automatically thanks to an opencv function) thank you for your help! :">
stefythebest Posted December 15, 2006 Author Posted December 15, 2006 sorry, i haven't posted my code!!! func action_agd_Button_1() $dll1 = DllOpen("C:/Documents and Settings/Media/Desktop/PROVE_DLL/nuova dll/Debug/nuova dll.dll") $risultato = DllCall($dll1, "void", "ApriImmagine", "void", "") DllClose($dll1) MsgBox(0,"Risultato della chiamata",$risultato) ;$result = DllCall("user32.dll", "int", "MessageBox", "hwnd", 0, "str", "Cancellare i dati?", "str", "Cancella dati", "int", 1) endfunc
stefythebest Posted December 18, 2006 Author Posted December 18, 2006 Please, give me an help..If i have made some mistake in the post, say it to me.
xcal Posted December 18, 2006 Posted December 18, 2006 I totally suck with DllCall, but I don't think you can use 'void.' Have a look here. How To Ask Questions The Smart Way
stefythebest Posted December 18, 2006 Author Posted December 18, 2006 Thank you for your help! I make a type int in the return typre of my function and now the code is: $dll1 = DllOpen("C:/Documents and Settings/Media/Desktop/rgb2gray/Debug/rgb2gray.dll") $risultato = DllCall($dll1, "int", "fnRgb2gray", "int", 1) MsgBox(0,"Risultato della chiamata",$risultato[1]) DllClose($dll1) However, when i try to show the parameters of the function fnRgb2gray, i obtain this error: Subscript used with non-Array variable.: could anyone help me? Obviously, the dll function doesn't make its work...
stefythebest Posted December 18, 2006 Author Posted December 18, 2006 Thank you xcal ,now i have solved my little problem and my gui works well!!
Richard Robertson Posted December 18, 2006 Posted December 18, 2006 The problem was that you don't need any parameters. DllCall("dll", "return", "function" [OPTIONAL_PARAMETERS]). Just DllCall($dll1, "int", "fnRgb2gray").
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