Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

OCX Compatibility

Posted on 2001-08-17
7
Medium Priority
?
426 Views
Last Modified: 2006-11-17
I built a complex OCX that I needed to use in a shell I made, and also give to another devloper to use in his shell.  The many peices of my OCX made it difficult to give him the whole thing, so I "stubbed it out."  I gave him an OCX that has all the public properties and methods, but no code.  He compiled it into his shell, and now I neeed to put the real OCX in.  I get the error:

"Failed to load <control> from <ocx>. Your version of <ocx> may be outdated. Make sure you are using the version of the control provided with your application."

On my OCX development computer, I have cleaned the registry of all references to the OCX.  I then copied the stub that I mailed to the other developer and registered it.  In the project, I had the compatibility pointing to the stub.  I am using Binary Compatibility.  I was under the assumption that by having the compatibility version be the stub, it will allow me to "upgrade" without problem, but I still get the error.  I'm hoping I'm just missing something stupid and that one of you geniuses will be able to help.  =)  

~Melissa
0
Comment
Question by:MelissaEvans
[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
  • 5
  • 2
7 Comments
 
LVL 6

Accepted Solution

by:
anthony_glenwright earned 60 total points
ID: 6399563
When you set up binary compatibility, did you store a copy of the OCX for backward-compatibility use, and point to it as the binary compatibility reference in the project properties page?  

I have had this problem before when the binary compatibility radio button is selected, but the path is set to the same file that I compile to.  

If you do point to the same file (which is incorrect), VB will not be able to read the old vtables from the old version to insert into your new version.
0
 

Author Comment

by:MelissaEvans
ID: 6407141
Yes and yes... I put the compatibility OCX where the new one will be compiled to.  I've noticed that VB has a hard time remembering where it was, it defaults back to where you last compiled, so instead of fighting it, I just put the compatibility file there too.  I've saved a version of the file I plan to use as a compatibilty OCX so as to not loose it completely.  
~Melissa
0
 
LVL 6

Expert Comment

by:anthony_glenwright
ID: 6409554
>> I put the compatibility OCX where the new one will be compiled to

This is the problem.  You must NOT point the compatibility OCX/DLL to the same path you compile to.  You have to make a copy of it.

This is because of the order (I think) in which VB does it's compile, which I think (from observation) is:

1.  Delete the old DLL/OCX/whatever
2.  Get the old vtable stuff
3.  Compile the new DLL/OCX/whatever

So, if you are pointing at the same location (for compatibility) as you are compiling to, you will not be binary compatible.  To solve the problem, create a /compat directory somewhere, and copy your OCX into it.  Then point your compatibility path to the version on the /compat directory.

When you are in-between "real" releases, dont update the version in /compat, but each time you make a real release (where you want to maintain backward compatibility), update the /compat version.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 6

Expert Comment

by:anthony_glenwright
ID: 6409556
And, just in case I'm misinterpreting what you are saying, if you have make a copy of the OCX with a different name, but in the same directory, I would recommend what I posted above, but with the same filename (but different directory) - just in case VB has a hard time understanding a different filename.
0
 
LVL 6

Expert Comment

by:anthony_glenwright
ID: 6409590
And, just in case I'm misinterpreting what you are saying, if you have make a copy of the OCX with a different name, but in the same directory, I would recommend what I posted above, but with the same filename (but different directory) - just in case VB has a hard time understanding a different filename.
0
 

Author Comment

by:MelissaEvans
ID: 6423622
It ended up being a licensing issue, but thank you for your time. =)
0
 
LVL 6

Expert Comment

by:anthony_glenwright
ID: 6424210
No problems.  I found a good link that explains versioning quite well the other day, if you are interested:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dn_voices_webservice/html/service08152001.asp?frame=true
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…
Suggested Courses

721 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