sambuddy Posted September 8, 2008 Posted September 8, 2008 Hello all, I have created a dll which has a function in it called OCR. At the moment the function looks like thisOCR_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 beBUT if i now change the function to take a string as a parameterOCR_DLL_API int OCR(LPCSTR name){return 1000;}and i call the function using this$return=DllCall($dll,"int","OCR","str","John")autoit crashesCan anyone tell me how i create the dll to accept a string as a parameter and pass it from autoit?Thanks
-Ultima- Posted September 8, 2008 Posted September 8, 2008 (edited) Dunno. Try LPCTSTR instead? Chances are, it won't work (it's just a different #define), but that's the only difference I see between your function and functions I normally call with DllCall :\ Edited September 8, 2008 by -Ultima- [ WinINet.au3 | Array.au3 (Optimized) | _UnixTimeParse() ]
sambuddy Posted September 8, 2008 Author Posted September 8, 2008 thanks for that. I have tried it but no luck
Richard Robertson Posted September 8, 2008 Posted September 8, 2008 (edited) Have you tried using a straight up "char *" or "wchar_t *"? Edited September 8, 2008 by Richard Robertson
LarryDalooza Posted September 8, 2008 Posted September 8, 2008 is this a cdecl or stdcall dll? Lar. AutoIt has helped make me wealthy
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now