kizsdet Posted January 24, 2011 Share Posted January 24, 2011 hi guys..can you help me with this one..i have a dll written in vb6.. Public Function addMe(x As Integer, y As Integer) As Integer addMe = x + y End Function how can i call it from autoit? here's what i have tried so far.. dim $test $test = DllCall("Project1.dll","int","addme","int",1,"int",2) msgbox("","try",$test) thanks in advance.. Link to comment Share on other sites More sharing options...
JohnOne Posted January 24, 2011 Share Posted January 24, 2011 (edited) Dont know anything about vb but dim $test $test = DllCall("Project1.dll","int","addme","int",1,"int",2) If @error then exit endif msgbox("","try",$test[0]) ; dllcall returns an array Edited January 24, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
kizsdet Posted January 24, 2011 Author Share Posted January 24, 2011 thanks for the reply sir but still doesn't work.. here's the error found after removing the error handler.. Subscript used with non-Array variable.: msgbox("","try",$test[0]) msgbox("","try",$test^ ERROR Link to comment Share on other sites More sharing options...
JohnOne Posted January 24, 2011 Share Posted January 24, 2011 You shouldnt get an error really, it should exit. dim $test $test = DllCall("Project1.dll","int","addme","int",1,"int",2) If @error then msgbox("","try",@error); look in the helpfile for @error codes for dllcall exit endif msgbox("","try",$test[0]) ; dllcall returns an array AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
kizsdet Posted January 27, 2011 Author Share Posted January 27, 2011 yes, its just exiting and not doing the dll function that why i remove the error handler to find whats the error. anyone who got solution for this? Link to comment Share on other sites More sharing options...
trancexx Posted January 27, 2011 Share Posted January 27, 2011 yes, its just exiting and not doing the dll function that why i remove the error handler to find whats the error.anyone who got solution for this?Get out of the freaking box you're in.Run the code JohnOne gave you. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Yashied Posted January 27, 2011 Share Posted January 27, 2011 "addme" => "addMe"$test = DllCall("Project1.dll", "int", "addMe", "int", 1, "int", 2) If Not @error Then MsgBox("", "try", $test[0]) EndIf My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... 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