Help with registering OCX's

webappguru

Member
Joined
Jan 16, 2005
Messages
7
Programming Experience
3-5
Hi. I need some assistance with a VB.NET Deployment. I wrote an app for a POS System. Each Piece (cash drawer, printer, pospole) came with an ocx. When I run my program on the live box, it says that the CLS ID ...... is not registered. I thought the project setup will automatically take care of this. Any thoughts....
 
If using an installer it would handle this for you. Otherwise you could create a .bat file that registers each OCX but it wouldn't be as elegant. For example, open Notepad and add lines such as:

RegSvr32 "C:\Windows\System32\MyControl1.OCX"
RegSvr32 "C:\Windows\System32\MyControl2.OCX"

Then save this file as RegControls.bat and execute it on the target machine.

I'd like to emphasize though you really should be using an installer so you don't cause version problems overwriting a newer version of the OCX you are using on the target machine and causing DLL HELL. There are also common practices as to where to install such files and again, please use an installer such as InstallShield as you are going to break applications on the target machine, hence why .NET was born!
 
I will try registering using regsvr32 but the strange thing is that using the VB.NET installer, it didnt actually do it. In the installer build I saw this error:

WARNING: Unable to create registration information for file named 'CoMsr18.ocx'


and it was listed 7 times for each ocx.... should i use regsvr32 on the live box
 
Last edited:
And I haven't used the VS installer much so I don't know how it handles COM/OCX i.e. whether it will handle the self-register or not.

Good luck!
 
Back
Top