Jump to content

Help with DllCall


Recommended Posts

Hello everyone. I am currently working on implementing Bluetooth functions: http://msdn.microsoft.com/en-us/library/windows/desktop/ee844558(v=vs.85).aspx in my autoit script.

The documentation says to use UCHAR for BluetoothIsVersionAvailable. I have tried UBYTE, UINT etc. but couldn't find UCHAR in Help file. I also checked Microsoft's typedef page, but no luck. Please help me to use UCHAR. Dllcall() returns @error = 1 or 3.

Thank you.

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

Thank you for trying. But I have already tried that:

$RESULT = DllCall("bthprops.cpl", "Bool", "BluetoothIsVersionAvailable", "Byte", 1, "Byte", 1)
msgbox(64, "", $RESULT & @error)

;) Using $RESULT[0] returns a 'Subscript used with non-array variable' error.

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

But thats not the case with other functions inside the same file. For instance:

$RESULT = DllCall("bthprops.cpl", "Bool", "BluetoothIsDiscoverable", "Handle", 0)
msgbox(64, "", $RESULT[0])

this works like charm. I believe the problem here is with UCHAR. I can't use byte, ubyte, uint etc. instead of UCHAR. Could someone please explain how to use UCHAR typedef with DllCall? And JFX, you could check bthprops.cpl Exports with an Export Viewer such as PE-Explorer etc. It does contain this function.

Thanx.

Edited by MKISH

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

Thanx a lot for your help guys. I upgraded my PC to Win7 Pro since XP was corrupt. The functions work well here. And yes, using BYTE instead of UCHAR did help.

Regards.

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...