Jump to content

CallDLL


 Share

Recommended Posts

Does anybody know why that's not working?

The function normally should return "ä". I also tried it with the Unicode version, but same result.

Dim $str1
    Dim $str2
    
    $str1=''
    $str2=''
    
    $res = DllCall( "user32.dll", "int", "OemToCharA", _
                    "str", $str1, _
                    "str", $str2)

    MsgBox(0, "", "error: " & @error & @CRLF _
                & "res: " & $res & @CRLF _
                & "str1: " & $str1 & @CRLF _
                & "str2: " & $str2)

OemToChar Windows API (MSDN Lib)

Link to comment
Share on other sites

Dim $str1
    Dim $str2
    
    $str1=''
    $str2=''
    
    $res = DllCall( "user32.dll", "int", "OemToChar", _
                    "str", $str1, _
                    "str", $str2)

    MsgBox(0, "", "error: " & @error & @CRLF _
                & "res: " & $res[0] & @CRLF _
                & "str1: " & $res[1] & @CRLF _
                & "str2: " & $res[2])

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

from the help file

If the function call fails then @error is set to 1. Otherwise an array is returned that contains the function return value and a copy of all the parameters (including parameters that the function may have modified).

$return[0]= function return value

$return[1] = param1

$return[2] = param2

...

$return[n] = paramn

you don't have to search, the function i helped you with will always place the value your looking for in $res[2] Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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