Jump to content

How to determine parameters to pass to a dll function


Recommended Posts

Hey,

I'm trying to write a script to do some ocr. I've tried the script that people have posted which uses MS Word to some degree of success but it still messes up some of the time. Now I've found a dll which is suppose to work better and I've used a dll viewer to get the function but I'm still having trouble determining what the parameters that need to be passed to the function are and how to call the function in autoit.

The function is "readNextChar" and this is what I have so far:

$dll = DllOpen("ocrDll.dll")

$strOCRResult=DllCall($dll,"?str?","readNextChar","?img?",$Image?,?,?) ; I've put ? where I'm not sure

DllClose($dll)

Any help would be greatly appreciated. Let me know if you gurus need anymore info.

Thanks

Link to comment
Share on other sites

Thanks ChrisL

That is what I'm looking for but for the ocrDll.dll (The link you sent was for the "simpleocx.dll" which I don't have). Currently, I'm trying to get a copy of the "simpleocx.dll" but in the meantime does anybody know how to call the functions from a dll? Is there some way to decompile the dll so you can find what parameters to pass? or is there an easier way?

Thanks again

Link to comment
Share on other sites

You will want to know the api of the DLL to know the params and what is returned for each function. Example is user32.dll on MSDN. They way you have called the DLL is fine, see the examples in the help file.

Are your sure readNextChar is in ocrDll.dll?

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

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