OCX Used for 2 different apps only found by 1 app

I have an OCX control that I have installed with Program1.  Program1 works fine, the ocx resides in the same directory as Program1 and Program1 is able to display the ocx control I am using.

I now have a Program2 that would like to use the same ocx but Program2 is located in a completely different directory structure than program1.  Even though the ocx was previously registred properly and works fine for Program1, Program2 is never able to find it.

Can you please explain why this happens and how I can resolve it?
panderson_1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DaireOSCommented:
The right way -> The OCX may not be registered correctly - try using "Regsvr32.exe" to register it (e.g. 'regsvr32 C:\Program1\MyControl.ocx') and then running program 2... An installer would take care of the by executing the DllSelfRegister in the ocx is directed.
The cheat way -> Put program2's folder on the system path.

Why does program 1 work?  By default applicaitons search the folder the reside in for sub-programs & libraries.
Why would the path method work? They also search the system path.

The best way - put the OCX in the "Windows\System32" folder and register it.
panderson_1Author Commented:
I have tried using regsvr32 to register it and I've also tried using an install program.  regsvr32 returns success, as does the install when installing program2, but program2 is still unable to find the ocx.  

so, if the ocx is in system32 then all apps will be able to find it because it is on the system path?
DaireOSCommented:
Should do - but (always a but) this may not always work with COM objects due to the need for registration.  If it's a COM library are you sure Program2 is compiled to use the correct library - if it's an app you wrote then you should open the source and check the component path (e.g. VB6 >> Project Menu >> Components >> find the OCX and the path is shown at the bottom).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DaireOSCommented:
if (Forced) ++lol;
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.