I'm making a call to the MODI DLL (Ms Office Document Imaging) for purposes of OCR. My concern is with corrupt images. The call was crashing my WinForms app so I tried putting it on a thread, hoping that I could timeout the thread if any problems arose. (Naturally I do have the relevant code in a try-catch block). But even the background thread causes the entire application to crash.
At this point I'm considering putting the MODI DLL in a command-line utility, but there's going to be a performance cost because I will have to read in an entire dictionary on every call as to validate the OCR-results.
Is there a better way to isolate the call to MODI so that it doesn't crash my entire app?