Solved

Problems installing an ocx I know work

Posted on 2001-06-19
4
187 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 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