sainthout Posted August 31, 2009 Share Posted August 31, 2009 (edited) Hi,I want to use the WiiYourself library in autoit, but I don't know how to call it's functions:bool wiimote::Connect (unsigned wiimote_index, bool force_hidwrites) { if(wiimote_index == FIRST_AVAILABLE) TRACE(_T("Connecting first available Wiimote:")); else TRACE(_T("Connecting Wiimote %u:"), wiimote_index);Can somebody help me a bit with this?Thnx Edited August 31, 2009 by sainthout Link to comment Share on other sites More sharing options...
monoceres Posted August 31, 2009 Share Posted August 31, 2009 The first code snippet you showed was a C++ class method, thus this is not a simple task. What you're seeing in the export viewer is the flat api version of the library. If you're lucky this works. $call=DllCall("wiimote.dll","int","ZN7wiimote7ConnectEjb","uint",0,"char",1) Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
sainthout Posted August 31, 2009 Author Share Posted August 31, 2009 (edited) Thnx for your reply. I tried it, but it sets @error to 1. When I try this it doesn't set @error, but it returns 0 (so it also didn't work) DllCall("wiimote.dll", "int", "_ZN7wiimote7ConnectEjb") Edited August 31, 2009 by sainthout Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 31, 2009 Share Posted August 31, 2009 Thnx for your reply. I tried it, but it sets @error to 1. When I try this it doesn't set @error, but it returns 0 (so it also didn't work) DllCall("wiimote.dll", "int", "_ZN7wiimote7ConnectEjb") You looked for that return value in an array... right? (You didn't post the code you tried.) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
gandaria700 Posted August 31, 2009 Share Posted August 31, 2009 (edited) You can’t call c function directly from Lua, you have to create a wrapper function that allows calling from Lua. In this post, shows a simple example to implement millisecond sleep function to Lua using nanosleep. Edited August 31, 2009 by Valik 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