FaT3oYCG Posted June 20, 2009 Share Posted June 20, 2009 (edited) Hi havent been arround here for a while but i have recently decided to pick autoit up again, i have decided to work on writing a bluetooth library. the problem that i have come accross is not finding the documentation, api calls and function references for my bluetooth dll but with the DLLCall function of autoit, i have looked at the documentation and the function i would like to use in the dll is a boolean return value but searching the documentation that is not documented to be a return type of the DLLCall function, can anyone help me out on that one. Thanks. Edited June 20, 2009 by FaT3oYCG Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right. Link to comment Share on other sites More sharing options...
Yashied Posted June 20, 2009 Share Posted June 20, 2009 (edited) DllCall('user32.dll', 'int', 'Beep', ... Edited June 20, 2009 by Yashied 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...
FaT3oYCG Posted June 20, 2009 Author Share Posted June 20, 2009 thanks, ok now i have a problem with sending a parameter to a nother function the function in the dll takes this formt according to the API BOOL function_name(DWORD dword_value) and the dword_value seems to take the form of a number i.e. a time in seconds ok so i have used $result = DLLCall($dll, "int", "function_name", "dword", "1") $result = DLLCall($dll, "int", "function_name", "dword", 1) $result = DLLCall($dll, "int", "function_name", "int", "1") $result = DLLCall($dll, "int", "function_name", "int", 1) yet autoit just crashes and gives error number -1073741819 Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 20, 2009 Moderators Share Posted June 20, 2009 (edited) thanks, ok now i have a problem with sending a parameter to a nother function the function in the dll takes this formt according to the API BOOL function_name(DWORD dword_value) and the dword_value seems to take the form of a number i.e. a time in seconds ok so i have used $result = DLLCall($dll, "int", "function_name", "dword", "1") $result = DLLCall($dll, "int", "function_name", "dword", 1) $result = DLLCall($dll, "int", "function_name", "int", "1") $result = DLLCall($dll, "int", "function_name", "int", 1) yet autoit just crashes and gives error number -1073741819How was the DLL compiled? Have you tried:$a_result = DLLCall($dll, "int:cdecl", "function_name", "dword", 1) MsgBox(64, "Bool Return", $a_result[0])? Edit: Also remember that the 3rd parameter is case sensitive. Edited June 20, 2009 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
FaT3oYCG Posted June 20, 2009 Author Share Posted June 20, 2009 thanks a load the cdecl was the problem, i dont realy know what that does but im guessing it has something to do with a C type declaration but yeah i know the third param is case sensitive but thanks for the advice now i can get to work making my bluetooth script thanks. Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right. Link to comment Share on other sites More sharing options...
martin Posted June 20, 2009 Share Posted June 20, 2009 (edited) thanks, ok now i have a problem with sending a parameter to a nother function the function in the dll takes this formt according to the API BOOL function_name(DWORD dword_value) and the dword_value seems to take the form of a number i.e. a time in seconds ok so i have used $result = DLLCall($dll, "int", "function_name", "dword", "1") $result = DLLCall($dll, "int", "function_name", "dword", 1) $result = DLLCall($dll, "int", "function_name", "int", "1") $result = DLLCall($dll, "int", "function_name", "int", 1) yet autoit just crashes and gives error number -1073741819I think that in C a boolean type can be the equivalent of "ubyte" in AutoIt so it is worth trying that. It's difficult to be sure because C doesn't actually have a boolean type and the author could have used a char type or int as a return value. If the value passed should be a dword then don't use a string. Also, are you certain the function is really called function_name? (or are you just using that for the example?) Try $result = DLLCall($dll, "int", "function_name", "dword", 0x00000001);but I think just 1 should work ;OR $result = DLLCall($dll, "ubyte", "function_name", "dword", 0x00000001) You might need to use the cdecl calling method, it depends how the dll was written $result = DLLCall($dll, "int:cdecl", "function_name", "dword", 0x00000001) ;and also try $result = DLLCall($dll, "ubyte:cdecl", "function_name", "dword", 0x00000001) Edited June 20, 2009 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
monoceres Posted June 20, 2009 Share Posted June 20, 2009 (edited) thanks a load the cdecl was the problem, i dont realy know what that does but im guessing it has something to do with a C type declaration but yeah i know the third param is case sensitive but thanks for the advice now i can get to work making my bluetooth script thanks.cdecl is a calling convention. It's a set of rules that determines how the interpreter/compiler should push the parameters on to the stack. If you use the wrong one the stack will be corrupted and after that it's game over. I think that in C a boolean type can be the equivalent of "ubyte" in AutoIt so it is worth trying that. It's difficult to be sure because C doesn't actually have a boolean type and the author could have used a char type or int as a return value.Just to clarify, in WINAPI ( written in C ) a BOOL is just a typedef for int. In C++ type called bool which is indeed one byte (as you said ubyte would be a good replacement in autoit). However I haven't seen the usage of a bool anywhere when using dll's (due to the fact that most libraries implemented as dll's are written in C).Edit: After reading martin's post again I changed my wordings. Edited June 20, 2009 by monoceres Broken link? PM me and I'll send you the file! 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