Solved

Problems installing an ocx I know work

Posted on 2001-06-19
4
182 Views
Last Modified: 2010-05-02
Hi,

I am normally not a VB developer but I am in process of updating an OCX for my company.

I must have messed something up because suddenly VB will not load the OCX. Believing that I had done something wrong I uninstalled it again and tried to reinstall the old versions of the OCX - which I know work. But when I try VB says

" could not be loaded

The OCX uses a DLL but I made sure to have the correct old version of the DLL present and the corresponding LIC file. All the files are copied in c:\windows\system

What is going on and how do I clean up so the old OCX can be used again?

I use VB 6 (SP 4)
0
Comment
Question by:felonius
  • 2
4 Comments
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6206312
Hi!

There are to resorts to that problem.

Resort1:

- Go to VB.

- Under the controls selection area, right-click and go to <Components...>

- Click onto the browse button and select the file, then click open.

- Use it for your app.

If Resort1 does not work, here's Resort2, but please note that Resort2 would only work for compiled VB programs and not the programming part of it (ie. Programming using the ocx).

- Place the ocx onto the same folder as your VB exe (ie. the one you compiled, not VB6.exe or whatever).

Try running your app - hopefully it runs.

If it still doesn't work, my help would have to stop here.

That's it!

glass cookie : )
0
 
LVL 1

Author Comment

by:felonius
ID: 6206352
I don't think you have understood my question. I do know how to install components and how to make them run. I have used lots OCXes and even written a few myself.

For some reason I cannot install it as a component, why? Can it be the registry that is messed up, somehow?

Jacob
0
 
LVL 3

Accepted Solution

by:
rmichels earned 100 total points
ID: 6206369
felonius

It sounds like you changed the OCX's interface?  Every OCX has a GUID (global identifier) that is used to uniquely identify it as an object.

When you reference an OCX in a VB project, it stores the OCX name and GUID in the VB project's VBP file.  If that GUID has changed, the VB project maynot be able to find the old object.

Another issue I have seens is the version number.  When you recompile an OCX, it's version number gets incremented.  The VB project using your OCX has the version number stored in the VBP as well.  If it cannot find that particular version, then it will fail.

This typically happens when you are developing on two different PCs, where you have incremented the version number locally, but not in a build environment.

In VB there is a setting called project compatibility. This controls how an OCX GUID is managed.  You have No Compatibility, Project Compatibility and Binary Compatibility.  Each one operates differently on how the GUIDs are maintained.  (You can check out more on these in Help).

Do you know if you changed these settings?  When you compiled your project, were you warned that you have made interface changes?

Did you change any public interfaces to the OCX? Either renaming an existing function or adding/deleting function parameters? or function return types?

Generally when you change an OCX, the goal is to maintain its compatibility with existing clients, so that the users of your OCX do not have to recompile.

I think more information is need from you to determine exactly what you did and what a solution may be.  
0
 
LVL 1

Author Comment

by:felonius
ID: 6206466
The problem can't have to do with vpb files because I can't even install the component OCX in a brand new project.

I have just opened by reg editor and deleted all keys/folders that had anything to do with my OCX, both the new and old one, including all the GUIDs. After that I rebooted and tried installing it again and all was suddenly fine.

I can only conclude that the error occured because either 1:
1. The list of GUIDs that VB6 maintain privately may have conflicted somehow with the one I wished to install.
2. The global registered GUIDs may have conflicted with the one I wanted to install.

Anyway, it works now and I know how to solve the problem in the future.

rmichels, I rewards you this question since that info is new to me and probably will turn out useful.

Jacob
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now