1

I got below error

Retrieving the COM class factory for component with CLSID {40942A6C-1520-4132-BDF8-BDC1F71F547B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

How can I retrieve MODI reference from COM in my application ? I have no dll file of MODI. & I have used the reference file called AxInterop.MODI & Interop.MODI But I am not able to execute the application.

I need this file to retrieve text from images.

Anyone can help me? code below:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
       //
    }

    private void btnclick_Click(object sender, EventArgs e)
    {
        MODI.Document objmodi = new MODI.Document();
        objmodi.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH,true,true);
        objmodi.Close(false);

        MODI.Image img = (MODI.Image)pictureBox1.Image;
        MODI.Layout lay = img.Layout;
        string text = lay.Text;
        txtdata.Text = text;
    }
}     

txtdata = Text Box , PictureBox1 = PictureBox to store image, & Btnclick = Button

wruckie
  • 1,717
  • 1
  • 23
  • 34
Hiren H Patel
  • 167
  • 3
  • 12
  • What version are you compiling your application in 32bit or 64 bit..? – MethodMan Feb 14 '12 at 13:53
  • 32 bit os. & using microsoft office 2007. & windows 7 OS – Hiren H Patel Feb 14 '12 at 14:04
  • If you are getting an error after the MODI.Document you have not added that reference and or using reference or both.. look at the example I posted.. should help you.. I also noticed in your example you are missing a file and or filename like where I have md.Create(fileToOCR); – MethodMan Feb 14 '12 at 14:27

0 Answers0