• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Problems installing an ocx I know work

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
felonius
Asked:
felonius
  • 2
1 Solution
 
glass_cookieCommented:
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
 
feloniusAuthor Commented:
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
 
rmichelsCommented:
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
 
feloniusAuthor Commented:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now