I have build myself an application that contains some ActiveX calendar
tools. I am using install shield to build my setup and that seems to be
cool too. The problem is that when I install and run the program I get the
message box error that says:

OLE error code 0x80040154: Class not registered. OLE object is being
ignored. Record number 5.

<s>. Does this mean that I am messing up my Install Shield build or that I
need to registered the objects by running something like:

Regsvr32 "C:\Program Files\Bblocks\ctBanner.ocx"

In a program on startup of the installation. I just have a feeling that I
am missing something very obvious.

Respectfully,

Jonathan Morningstar

Re: Ocx Registration Q. by Sietse

Sietse
Sun Sep 19 14:12:55 CDT 2004

Hi Morningstar,

> <s>. Does this mean that I am messing up my Install Shield build or that I
> need to registered the objects by running something like regsvr32
> in a program on startup of the installation. I just have a feeling that I
> am missing something very obvious.

Installshields has good capabiliries to register the OCX for you, so you
don't have to bother for registering the ocx in the startup of your program.
In my opinion it's good manner to check for correct installation of the
OCX's in the startup of the progam by checking for availability of the class
in the registry and give a message to the user if he class isn't found. This
is better than registring the class yourself on startup of the program
bcause of the ocx's location on the harddisk.

HTH,
Sietse Wijnker


"Morningstar" <REMOVEjm@ablecon.com> wrote in message
news:414dd245$1_1@127.0.0.1...
>I have build myself an application that contains some ActiveX calendar
>tools. I am using install shield to build my setup and that seems to be
>cool too. The problem is that when I install and run the program I get the
>message box error that says:
>
> OLE error code 0x80040154: Class not registered. OLE object is being
> ignored. Record number 5.
>
> <s>. Does this mean that I am messing up my Install Shield build or that I
> need to registered the objects by running something like:
>
> Regsvr32 "C:\Program Files\Bblocks\ctBanner.ocx"
>
> In a program on startup of the installation. I just have a feeling that I
> am missing something very obvious.
>
> Respectfully,
>
> Jonathan Morningstar
>



Re: Ocx Registration Q. by Morningstar

Morningstar
Sun Sep 19 16:09:30 CDT 2004

>>OCX's in the startup of the progam by checking for availability of the
>>class in the registry and give a message to the user if he class isn't
>>found.

How do you do this?

Jonathan M*

"Sietse Wijnker" <sietse.wijnker@ATsw-software.nl> wrote in message
news:OeoH8ynnEHA.2576@TK2MSFTNGP10.phx.gbl...
> Hi Morningstar,
>
>> <s>. Does this mean that I am messing up my Install Shield build or that
>> I need to registered the objects by running something like regsvr32
>> in a program on startup of the installation. I just have a feeling that
>> I am missing something very obvious.
>
> Installshields has good capabiliries to register the OCX for you, so you
> don't have to bother for registering the ocx in the startup of your
> program.
> In my opinion it's good manner to check for correct installation of the
> OCX's in the startup of the progam by checking for availability of the
> class in the registry and give a message to the user if he class isn't
> found. This is better than registring the class yourself on startup of the
> program bcause of the ocx's location on the harddisk.
>
> HTH,
> Sietse Wijnker
>
>
> "Morningstar" <REMOVEjm@ablecon.com> wrote in message
> news:414dd245$1_1@127.0.0.1...
>>I have build myself an application that contains some ActiveX calendar
>>tools. I am using install shield to build my setup and that seems to be
>>cool too. The problem is that when I install and run the program I get
>>the message box error that says:
>>
>> OLE error code 0x80040154: Class not registered. OLE object is being
>> ignored. Record number 5.
>>
>> <s>. Does this mean that I am messing up my Install Shield build or that
>> I need to registered the objects by running something like:
>>
>> Regsvr32 "C:\Program Files\Bblocks\ctBanner.ocx"
>>
>> In a program on startup of the installation. I just have a feeling that
>> I am missing something very obvious.
>>
>> Respectfully,
>>
>> Jonathan Morningstar
>>
>
>



Re: Ocx Registration Q. by Sietse

Sietse
Sun Sep 19 17:44:37 CDT 2004

In your example you're using the ctBanner OCX from the DBITech Toolkit. This
control is based on a class which is instanciated in the OLE container. This
class in this case is the CTBanner.CTBanner3 class. You can see the
classname in the OLEClass propert of the OLEContainer control.

This class is just like the Word.Application class you use with automation:
oWord = CREATEOBJECT("Word.Application")
When you instanciate the class the class is searched by VFP in a specific
order (from VFP8 help topic CREATEOBJECT):
1. Visual FoxPro base classes.
2. Classes in the current program.
3. Classes in .vcx class libraries opened with SET CLASSLIB.
4. Classes in procedure files opened with SET PROCEDURE.
5. Classes in the Visual FoxPro program execution chain.
6. The OLE registry if SET OLEOBJECT is ON.

In the case of the OLEObjects, the classes are defined in the root of the
HKEY_CLASSES_ROOT of the registry.
When the OCX is properly registered the ctBANNER.ctBannerCtrl.3 key is founc
in the HKEY_CLASSES_ROOT. This key has a sub-key named CLSID which stores a
GUID ({990069E6-CACB-11D4-A1FF-00E098856412}). This GUID points to a key in
the HKEY_CLASSES_ROOT\CLSID key:
HKEY_CLASSES_ROOT\CLSID\{990069E6-CACB-11D4-A1FF-00E098856412}
There you can find numerous sub-keys, f.i. on where the OCX-file is stored
(the InprocServer32-key)

You can make the check more or less advanced. When the
HKEY_CLASSES_ROOT\ctBanner.ctBannerCtrl.3 key exists it can be sufficient,
but you can also read the value of the
HKEY_CLASSES_ROOT\ctBanner.ctBannerCtrl.3\CLSID\(default) key value and use
tht value to retrieve where the OCX should be on the hard-drive and check if
the file still exists.
To do so you can use the _registry.vcx wrapper from the foundation classes,
or you can use the RegOpenKey, RegCloseKey, RegQueryValueEx API functions
directly.

HTH,
Sietse Wijnker

"Morningstar" <REMOVEjm@ablecon.com> wrote in message
news:414df5ad_1@127.0.0.1...
>>>OCX's in the startup of the progam by checking for availability of the
>>>class in the registry and give a message to the user if he class isn't
>>>found.
>
> How do you do this?
>
<snipped>