Jump to content
Sign in to follow this  

Can I pass a literal string to DllCall...

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!


Share this post

Link to post
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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.