Jump to content

How do i pass a string to a dll


sambuddy
 Share

Recommended Posts

Hello all,

I have created a dll which has a function in it called OCR. At the moment the function looks like this

OCR_DLL_API int OCR(void)

{

return 1000;

}

and when i call the function in the dll

$return=DllCall($dll,"int","OCR")

$return = 1000 which is what it should be

BUT if i now change the function to take a string as a parameter

OCR_DLL_API int OCR(LPCSTR name)

{

return 1000;

}

and i call the function using this

$return=DllCall($dll,"int","OCR","str","John")

autoit crashes

Can anyone tell me how i create the dll to accept a string as a parameter and pass it from autoit?

Thanks

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