dddienst Posted November 30, 2009 Share Posted November 30, 2009 Ok, I am trying to evaluate the Screen OCR SDK and I am having some trouble because the primary function I want to call in there DLL needs to be passed a pointer to a class. I can see that AutoIt supports DLL Calls and even some support for creating Structures to pass to DLL functions but how do I Create load and pass a class? Here is a snipit from the header file they give to use with the DLL. class TextractSource { public: TextractSource(); TextractSource& BmpFile(const char *bmpFileName); TextractSource& Wnd(HWND); TextractSource& Rect(int ax, int ay, int bx, int by); TextractSource& DesktopWnd(); TextractSource& TopWnd(const char *windowClass, const char *windowText); TextractSource& DeepWnd(const char *windowClass, const char *windowText); TextractSource& SubWnd(const char *windowClass, const char *windowText); TextractSource& SubDeepWnd(const char *windowClass, const char *windowText); TextractSource& FindLargestWindow(); const char *BmpFileName; // used if != NULL HWND W; // used if != NULL int AX, AY, BX, BY; // used if BmpFileName == NULL and Wnd == NULL }; TextractExport TextractSuccess Textract(TextractSource&, TextractDest&, TextractDestFormat); I have only included one class for brevity but TextractDest is also a class. TextractSuccess is just a long. Thanks, dddienst P.S. I see many here prefer to use Tesseract but I am using Win7 which that has trouble with so I wish to try this method. OR would it be better to use VB and access both AutoIt and ScreenOCR with COM interfaces since both also have support for that method. I just don't what to make things more complex then they need to be. Link to comment Share on other sites More sharing options...
Authenticity Posted December 1, 2009 Share Posted December 1, 2009 $tTextractSource = DllStructCreate("ptr BmpFileName;hwnd W;int AX;int AY;int BX;int BY;") $pTextractSource = DllStructGetPtr($tTextractSource) $aRes = DllCall("dllname.dll", "int:cdecl", "Textract", "ptr", $pTextractSource, "ptr", $pTextractDest) Several things are assumed here: TextractSuccess is an enumeration (int), that class is a simple one, no polymorphism is involved and that the calling convention is __cdecl. Change the necessary fields. Link to comment Share on other sites More sharing options...
leonick5 Posted January 12, 2010 Share Posted January 12, 2010 Change the necessary fields???? I am also struggling with this since 2 days. but cannot make it work.http://www.autoitscript.com/forum/index.php?showtopic=108107 Link to comment Share on other sites More sharing options...
ChlWil Posted January 26, 2010 Share Posted January 26, 2010 +1 I'm also confused by this. Dont know how to return the recognized data to text at all. Plz any help is greatly appreciated! Link to comment Share on other sites More sharing options...
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