Jump to content

Recommended Posts

Posted (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);

Posted Image

Can somebody help me a bit with this?

Thnx

Edited by sainthout
Posted

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!

Posted (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 by sainthout
Posted

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.)

:D

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
Posted (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 by Valik

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...