|
It's very useful,Thanks.
however,i have a small question:what should i do if i want to build it in VS 6.0
|
|
|
|
|
I opened the MODIVCDemo code by Visual C++ .NET, and successfully rebuilt the solution. However, when I click the "OCR" button, it reports "ERROR". According to those people who experienced the same problem, I reinstalled Office 2003, but it still couldn't work. In the Debug mode, I found where the error occurred.
When I use bReadOCRByMODI(), the error occurs in the following line:
hr = IDobj->Create(AsciiToBSTR(csFilePath));
When I use bReadOCRByMODIAXCtrl(), the error occurs in the following line:
hr = IDobj->OCR(miLANG_SYSDEFAULT,1,1);
What should I do? Would anybody help me?
|
|
|
|
|
my problem smae with you please help us
|
|
|
|
|
It is not the office's fault, but yours.
select the right language(in the sample code it's miLANG_SYSDEFAULT,that's setted as your OS) and then rebuilt the project and retry "OCR". If you try the *.tif in the \SampleImage folder, modify as below
hr = IDobj->OCR(miLANG_ENGLISH,1,1);//miLANG_SYSDEFAULT
you can choose following language based on your OCR object
enum MiLANGUAGES
{
miLANG_CHINESE_SIMPLIFIED = 2052,
miLANG_CHINESE_TRADITIONAL = 1028,
miLANG_CZECH = 5,
miLANG_DANISH = 6,
miLANG_DUTCH = 19,
miLANG_ENGLISH = 9,
miLANG_FINNISH = 11,
miLANG_FRENCH = 12,
miLANG_GERMAN = 7,
miLANG_GREEK = 8,
miLANG_HUNGARIAN = 14,
miLANG_ITALIAN = 16,
miLANG_JAPANESE = 17,
miLANG_KOREAN = 18,
miLANG_NORWEGIAN = 20,
miLANG_POLISH = 21,
miLANG_PORTUGUESE = 22,
miLANG_RUSSIAN = 25,
miLANG_SPANISH = 10,
miLANG_SWEDISH = 29,
miLANG_TURKISH = 31,
miLANG_SYSDEFAULT = 2048
};
|
|
|
|
|
i will try with suggest of you,thanks you very much.
|
|
|
|
|
i will try with suggest of you.
|
|
|
|
|
i have a question for you????i meet an obstacle when run program "MODIVDemo__OCR" ??there is:"modivc6\MDIVWCTL.tlh : can not open file" i ask you,i can find "modivc6"????
|
|
|
|
|
MDIVWCTL.tlh is an auto-generated type libary by the compiler when MDIVWCTL.dll is imported. I include this type libary because I don't want to distribute MDIVWCTL.dll.
The project is compiled with VS2003. USing the default conversion if you open it in
VS 2005. Also, I have to use a copy of image file loaded in the MODI ViewCtrl to do the OCR to workaround the crashing issue when MODI ViewCtrl closed on application exit.
Something like this:
void CMODIVCDemoDlg::OnButtonOcr()
{
// TODO: Add your control notification handler code here
CString csText;
CString csFilePath;
GetDlgItemText(IDC_EDIT_FILE_PATH,csFilePath);
//Make copy of image file before pass to OCR engine
CString csOCRTemp;
csOCRTemp = csFilePath.Left(csFilePath.GetLength()-4) +"-temp.tif";
CopyFile(csFilePath,csOCRTemp,FALSE);
if ( bReadOCRByMODI(csOCRTemp,csText) == TRUE )
{
SetDlgItemText(IDC_EDIT_TEXT,csText);
}else {
SetDlgItemText(IDC_EDIT_TEXT,"ERROR");
}
}
|
|
|
|
|
i can't open "MODIVDemo"!!! can you help me??? (i use visual studio 2005)thank you very much!!
-- modified at 11:54 Saturday 10th November, 2007
|
|
|
|
|
I rebuild the project in the VC++6.0. when I open the TIFF imaging that you offer and play the OCR button,then it shows ERROR ,then I exit ,it shows a messagebox about something like 'memory can't be read'.Can you offer update one. Thx!
|
|
|
|
|
Hi Thomas,
I've had the same problem, because MS Office 2003 wasn't installed correctly.
After a new installation everything went fine, so you could try out this.
Chris
|
|
|
|
|
Thank you for your advice.I will try.
|
|
|
|
|
Plz send me a sorce code.....
I am getting debugg adssertion failed....
|
|
|
|
|
Hi Thomas Shao,
I've had the same problem, after I set the regional setting (from windows control panel) into English (United State) the problem was solve
Wiem
|
|
|
|
|
Hi,
I've just tried out the sample and it's very helpful for me, but ...
... I am unable to set a text selection by program code.
I want to search a part of a tiff file, but it might be empty.
I can get a TextSelection by m_MODIctrl.GetTextSelection(), and put it back with SetTextSelection, but how can I manipulate the content of the CMiSelectableItem object or create a new one ?
Maybe it's very simple, but I am not familiar with using Active X objects ?
Thx in advance,
Chris
p.s. Is there a detailed MODI Documentation for C++ ?
|
|
|
|
|
Hi,
I have tried MODI to read Chinese text, I modify the code of bReadOCRByMODIAXCtrl
hr = IDobj->OCR(miLANG_CHINESE_SIMPLIFIED,1,1);
but the output result is invisible characters, only numerals can be rightly recognized.
Why?
Can you help me?
Thanks!
|
|
|
|
|
I know it works for Chinese Simplified characters, make sure the fonts OCRed matching the font in the MS office.
|
|
|
|
|
enum MiLANGUAGES
{
miLANG_CHINESE_SIMPLIFIED = 2052,
miLANG_CHINESE_TRADITIONAL = 1028,
miLANG_CZECH = 5,
miLANG_DANISH = 6,
miLANG_DUTCH = 19,
miLANG_ENGLISH = 9,
miLANG_FINNISH = 11,
miLANG_FRENCH = 12,
miLANG_GERMAN = 7,
miLANG_GREEK = 8,
miLANG_HUNGARIAN = 14,
miLANG_ITALIAN = 16,
miLANG_JAPANESE = 17,
miLANG_KOREAN = 18,
miLANG_NORWEGIAN = 20,
miLANG_POLISH = 21,
miLANG_PORTUGUESE = 22,
miLANG_RUSSIAN = 25,
miLANG_SPANISH = 10,
miLANG_SWEDISH = 29,
miLANG_TURKISH = 31,
miLANG_SYSDEFAULT = 2048
};
|
|
|
|
|
you can carefully see this file directory\MODIVCDemo\MDIVWCTL.tlh and this webpage
http://msdn2.microsoft.com/en-us/library/aa167607.aspx
|
|
|
|
|
how to get multiple recognition candidates for one word?
|
|
|
|
|
Can I deploy it without office2003 installed? thanks?
|
|
|
|
|
|
If you using .net supportive languages like c#,vb.net and vc++ .net..the CLR to take over the job for adding reference to your project,as it is if you using vc++,you should be take the response for adding references to your project that is first you have to create .idl file and .h file to your library...
|
|
|
|
|
Hi
What about MODI for office 2007?
Thanx
|
|
|
|
|
Hi.
I tried to use MODI with Office 2007, but OCR() method returned HRESULT 0xC6C8111E. GetLastError() returned 2. 2 means that some file is missing, but which? I have Office 2007 MODI ActiveX componnent properly registered in Win. So what is missing? There is no log in the Event Viewer related to this problem. Even in the trace output. Thank you for your help.
B.
|
|
|
|
|