Solved

Problems installing an ocx I know work

Posted on 2001-06-19
4
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

689 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