Jump to content

Can I pass a literal string to DllCall...


Angel
 Share

Recommended Posts

The DllCall documentation says that DllCall returns an array with copies of the input arguments, including those that were modified by the function.

But imagine, for example, a function that turns a string into uppercase.

int toUpperCase(char*)

Could I safely do the following in AutoIt?:

Dim $v_results = DllCall("my_dll.dll", "int","toUpperCase", "str", "this is an example")
Dim $my_string= $v_results[1]

and get "THIS IS AN EXAMPLE" in $my_string?

This would not be correct in C, as I would need to pass a non constant pointer to the function so that it can modify it (and thus I could get the results). But here, if DllCall just puts copies of the results in the result array it seems correct. Is that right?

Thanks in advance!

Angel

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