Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Message "Class Not Registered" when dropping new component onto form

Using Windows XP running Delphi 2010.

I have been provided with a third party package called CsdEft.ocx (for interfacing to EFTPOS terminals)

To install I did the following:

  • Select "Import Component"
  • Select "Import ActiveX Control"
  • Select "Add" then select CsdEft.ocx. The selected OCX is displayed. Click Next.

    Shows dialog:

    Class Name: TCscEFT

    Pallet Page: ActiveX

    Unit Dir Name: C:\Delphi\Components

    Search Path: $(BDS)\lib;$(BDSUSERDIR)...................

    Generate Component Wrappers - Checked

  • Click Next.
  • Select "Install into New Package"
  • Enter EFTPOS as the package name.
  • Click Finish.

    Dialog shows:

    Package C:\Documents and Settings.............\EFTPOS1.bpl has been installed. The following component(s) have been registered: TCsdEft.

OK . All looks fine.

I can see the component in the ActiveX page in the Component Pallet.

BUT when I try to select the component and drop it on a form I get "Class Not Registered" error.

Hopefully someone can give me some pointer to what is wrong here.

like image 660
user576639 Avatar asked Dec 07 '22 01:12

user576639


1 Answers

Sounds like the OCX itself is not registered with Windows using the command-line regsvr32.exe tool. You imported the OCX file directly, so the IDE created a component wrapper based on the OCX's embedded TypeLibrary, but the wrapper is going to try to instantiate the ActiveX object via CoCreateInstance(), so you will get a "Class not registered" error if CoCreateInstance() cannot find the OCX.

like image 70
Remy Lebeau Avatar answered Dec 28 '22 12:12

Remy Lebeau