Solved

Problems installing an ocx I know work

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vb.net 2008 2 56
VB6 Compile Compatibility Issue 4 90
Help with retrieving partial value from a column using VB.NET 4 42
vbModal 12 34
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

910 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

24 Experts available now in Live!

Get 1:1 Help Now