I am developing my project in VC++ 2005. I added tessnet2.dll reference and
call it from the manged C++ code. The code is as follows:
/////////////////////////////////////////////////////
System::Drawing::Bitmap^ tessImg = gcnew
System::Drawing::Bitmap(Application::StartupPath + "\\temp.tif");
Tesseract^ ocr = gcnew Tesseract();
ocr->Init("ban", false);
*System::Collections::Generic::List<tessnet2::Word ^> ^ result =
ocr->DoOCR(tessImg, Rectangle::Empty);*
System::String^ strRes = "";
int numOfLine = Tesseract::LineCount(result);
for(int lc = 0; lc<numOfLine; lc++){
strRes += Tesseract::GetLineText(result, lc);
}
/////////////////////////////////////////////////////
I am getting the error while the line (red colored) is executing.
On Tue, Oct 21, 2008 at 12:23 PM, rthomas <[EMAIL PROTECTED]> wrote:
>
> For example, to build the solution I use
> (A) a native static C++ library build using static C runtime library
> (B) a C++/CLI wrapper for (A)
> (C) tessnet2 wrapper
> (D) a C# project linking with (A), (B) and (C)
>
> This example works badly, (A) must be compile using DLL C runtime
> library
>
> What is the solution you are using?
>
> On Oct 20, 2:21 pm, Hasnat <[EMAIL PROTECTED]> wrote:
> > Dear Remi,
> > I think I am in the same configuration. I am developing
> my
> > project in VC++ 2005. I am not sure exactly what you mean by project
> list.
> > Also please let me know how to get the list.
> >
> >
> >
> >
> >
> > On Mon, Oct 20, 2008 at 5:55 PM, rthomas <[EMAIL PROTECTED]> wrote:
> >
> > > Hi,
> >
> > > Searching for "FlsAlloc MSCOREE" in Google point me to the page
> >
> > >http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/f204b.
> ..
> >
> > > Are you in the same configuration?
> > > Can you describe the VS solution you are using (the project list and
> > > type for building your solution)?
> >
> > > Rémi
> >
> > > On Oct 20, 8:27 am, Hasnat <[EMAIL PROTECTED]> wrote:
> > > > Thanks Remi for your response. I have tried to follow the
> instructions
> > > that
> > > > you mentioned in your email. My feedback is as follows:
> >
> > > > *1.* I download "Microsoft Visual C++ 2005 SP1 Redistributable
> Package"
> > > and
> > > > install it. But yet no improvement of the error.
> >
> > > > *2.* I download "Dependency Walker" and while I load my
> BanglaOCR.exe,
> > > > although it was successful in opening the exe file but it shows error
> in
> > > > opening "MSJAVA.DLL" file. Then I profile the exe (start profiling by
> F7)
> > > > and it information which I attached with a file named "Profile
> > > > BanglaOCR_exe.txt" with this email.
> >
> > > > *3.* Next I tried to open the tessnet2.dll file using the dependency
> > > walker
> > > > and it failed to open it due to the error in opening files
> "MSVCR80.DLL"
> > > and
> > > > "MSJAVA.DLL".
> >
> > > > 4. Next I run FileMon and observed the file system activity. I saved
> the
> > > log
> > > > file and saved important portion of the log to observe. The filemon
> log
> > > is
> > > > attached with this email in a file named "Filemon.LOG".
> >
> > > > Now as I am not an expert of Visual Studio so I am unable to identify
> the
> > > > entire problems. Looking forward for the next instructions.
> >
> > > > On Sun, Oct 19, 2008 at 3:45 PM, rthomas <[EMAIL PROTECTED]>
> wrote:
> >
> > > > > Hi,
> >
> > > > > This error is usualy solve reinstalling Microsoft Visual C++ 2005
> SP1
> > > > > Redistributable Package. Did you try?
> > > > > If the answer is yes, try starting with two different monitoring
> tools
> > > > > -http://www.dependencywalker.com/andrun the app in profiling mode
> > > > > (F7)
> > > > > - then try with Sysinternal FileMon (
> http://technet.microsoft.com/en-
> > > > > us/sysinternals/bb896642.aspx<
> > >http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx>)
> > > > > and search for the file the app is
> > > > > looking for.
> >
> > > > > When found the problem please report here what was missing.
> >
> > > > > Remi
> >
> > > > > On Oct 19, 10:03 am, Hasnat <[EMAIL PROTECTED]> wrote:
> > > > > > Dear Hessein,
> > > > > > thanks for your advice. I have already tried
> it.
> > > And
> > > > > > there was no difference. Only one different that I observed that
> is
> > > to
> > > > > view
> > > > > > the exact reason of the error. In one pc it was showing the
> microsoft
> > > > > > anonymous problem and showing the dialogue box of sending error
> > > message.
> > > > > In
> > > > > > the 2nd pc while it failed it showed the actual error of loading
> dll
> > > > > > problem. What I feel that I should build the project in my pc and
> > > > > generate
> > > > > > the dll file from the source again. However I didn't test it yet.
> Is
> > > > > there
> > > > > > any dot net expert who can better answer about this problem?
> >
> > > > > > On Sat, Oct 18, 2008 at 11:20 PM, Hussein <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > > > Try running the small image and the large image on a different
> > > computer
> > > > > > > with bigger RAM or a computer with VC++ and SP1 installed (two
> > > > > different
> > > > > > > scenarios).
> >
> > > > > > > If the large image fails on both tests, then the larger file
> may be
> > > > > > > unreadable by the software. If it runs on the computer with
> bigger
> > > > > RAM,
> > > > > > > then your current computer may not have enough RAM to load the
> > > large
> > > > > image.
> >
> > > > > > > Hussein Al-Hussein
> >
> > > > > > > ------------------------------
> >
> > > > > > > Date: Sun, 19 Oct 2008 09:54:24 +0600
> > > > > > > From: [EMAIL PROTECTED]
> > > > > > > To: [email protected]
> > > > > > > Subject: Re: problem with tessnet loading (any suggestion?)
> >
> > > > > > > I go the information about the redistributable package that -
> "The
> > > > > > > Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)
> > > installs
> > > > > runtime
> > > > > > > components of Visual C++ Libraries required to run applications
> > > > > developed
> > > > > > > with Visual C++ on a computer *that does not have Visual C++
> 2005
> > > > > > > installed*". Here I would like to mention that I am developing
> my
> > > > > > > application with Visual C++ 2005. So, according to the
> statement
> > > above
> > > > > I do
> > > > > > > not need to install the package as I already have it. Now, is
> there
> > > any
> > > > > > > other solution of the problem??
> >
> > > > > > > On 10/18/08, *nguyenq* <[EMAIL PROTECTED]> wrote:
> >
> > > > > > > It has been mentioned in one of previous posts that the
> solution to
> > > > > > > this problem is to install Microsoft Visual C++ 2005 SP1
> > > > > > > Redistributable Package.
> >
> > >http://www.microsoft.com/downloads/details.aspx?familyid=200b2fd9-ae1.
> > > > > ..
> >
> > > > > > > On Oct 17, 11:26 pm, Hasnat <[EMAIL PROTECTED]> wrote:
> > > > > > > > I am facing problem on loading the tessnet dll. The error
> report
> > > is
> > > > > as
> > > > > > > > follows:
> >
> > > > > > > > System.IO.FileLoadException: *Could not load file or assembly
> > > > > 'tessnet2*,
> > > > > > > > Version=2.0.3.6, Culture=neutral, PublicKeyToken=null' or
> one of
> > > its
> > > > > > > > dependencies. This application has failed to start because
> the
> > > > > > > application
> > > > > > > > configuration is incorrect. Reinstalling the application may
> fix
> > > this
> > > > > > > > problem. (Exception from HRESULT: 0x800736B1)
> > > > > > > > File name: 'tessnet2, Version=2.0.3.6, Culture=neutral,
> > > > > > > PublicKeyToken=null'
> > > > > > > > ---> System.Runtime.InteropServices.COMException
> (0x800736B1):
> > > This
> > > > > > > > application has failed to start because the application
> > > configuration
> > > > > is
> > > > > > > > incorrect. Reinstalling the application may fix this problem.
> > > > > (Exception
> > > > > > > > from HRESULT: 0x800736B1)
> >
> > > > > > > > I am emailing this to the group considering that this might
> be
> > > faced
> > > > > by
> > > > > > > any
> > > > > > > > other developer in future. I want to mention here that when I
> > > tried
> > > > > to
> > > > > > > test
> > > > > > > > my application with a small image it worked. However when I
> tried
> > > > > with a
> > > > > > > > large image this dll loading problem arise.
> >
> > > > > > > > Any help in this issue will be appreciable.
> >
> > > > > > > > Regards,
> > > > > > > > --
> > > > > > > > Hasnat
> > > > > > > > Center for Research on Bangla Language Processing (CRBLP)
> > > > > > >http://mhasnat.googlepages.com/
> > > > > > > <br
> >
> > > > > > Regards,
> > > > > > --
> > > > > > Hasnat
> > > > > > Center for Research on Bangla Language Processing (CRBLP)
> > > > >http://mhasnat.googlepages.com/
> >
> > > > Regards,
> > > > --
> > > > Hasnat
> > > > Center for Research on Bangla Language Processing (CRBLP)
> > >http://mhasnat.googlepages.com/
> >
> > > > [Profile BanglaOCR_exe.txt3K
> > >
> ]--------------------------------------------------------------------------------
> > > > Starting profile on 10/20/2008 at 11:49:07 AM
> >
> > > > Operating System: Microsoft Windows XP Professional (32-bit), version
> > > 5.01.2600 Service Pack 2
> > > > Program Executable: c:\documents and settings\hasnat\desktop\windows
> > > bangla ocr\tbanglaocr\banglaocr\release\BANGLAOCR.EXE
> > > > Program Arguments:
> > > > Starting Directory: C:\Documents and Settings\Hasnat\Desktop\Windows
> > > Bangla OCR\TBanglaOCR\BanglaOCR\Release\
> > > > Search Path:
> > > C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
> > > Files\Intel\DMIX;C:\Program Files\Microsoft SQL
> > > Server\90\Tools\binn\;C:\Program Files\Java\jdk1.6.0_02\bin;C:\Program
> > > Files\Ant\bin;C:\PROGRA~1\ATT\Graphviz\bin;C:\MATLAB7\bin\win32
> >
> > > > Options Selected:
> > > > Simulate ShellExecute by inserting any App Paths directories
> into
> > > the PATH environment variable.
> > > > Log DllMain calls for process attach and process detach
> messages.
> > > > Hook the process to gather more detailed dependency information.
> > > > Log LoadLibrary function calls.
> > > > Log GetProcAddress function calls.
> > > > Log debug output messages.
> > > > Automatically open and profile child processes.
> >
> > >
> --------------------------------------------------------------------------------
> >
> > > > Started "BANGLAOCR.EXE" (process 0x15F4) at address 0x00400000.
> > > Successfully hooked module.
> > > > Loaded "NTDLL.DLL" at address 0x7C900000. Successfully hooked
> module.
> > > > Loaded "MSCOREE.DLL" at address 0x79000000. Successfully hooked
> module.
> > > > Loaded "KERNEL32.DLL" at address 0x7C800000. Successfully hooked
> module.
> > > > DllMain(0x7C900000, DLL_PROCESS_ATTACH, 0x00000000) in "NTDLL.DLL"
> > > called.
> > > > DllMain(0x7C900000, DLL_PROCESS_ATTACH, 0x00000000) in "NTDLL.DLL"
> > > returned 1 (0x1).
> > > > DllMain(0x7C800000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNEL32.DLL"
> > > called.
> > > > DllMain(0x7C800000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNEL32.DLL"
> > > returned 1 (0x1).
> > > > Injected "DEPENDS.DLL" at address 0x08370000.
> > > > DllMain(0x79000000, DLL_PROCESS_ATTACH, 0x00000000) in "MSCOREE.DLL"
> > > called.
> > > > DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "DEPENDS.DLL"
> > > called.
> > > > DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "DEPENDS.DLL"
> > > returned 1 (0x1).
> > > > GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from
> > > "MSCOREE.DLL" at address 0x7900746D and returned 0xFFBADD11.
> > > > Exited "BANGLAOCR.EXE" (process 0x15F4) with code -1073740791
> > > (0xC0000409).
> >
> > --
> > Hasnat
> > Center for Research on Bangla Language Processing (CRBLP)
> http://mhasnat.googlepages.com/- Hide quoted text -
> >
> > - Show quoted text -
> >
>
--
Hasnat
Center for Research on Bangla Language Processing (CRBLP)
http://mhasnat.googlepages.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tesseract-ocr" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en
-~----------~----~----~----~------~----~------~--~---