-
Aug 2nd, 2021, 06:03 AM
#1
Thread Starter
Registered User
VB 372 error : Failed to load control y from x.ocx. Your version of y maybe outdated.
Hello All,
I have a desktop application which is deployed on client machine, the client randomly gets this error once or twice a day. The ocx file and the control are my own custom controls. I have checked the version of the ocx and it all matches and are correct. I have also verified the version of the ocx in the registry and everything is correct there also.
Do you guys have any other pointers which can help me in this issue?
Exact Error :
Failed to load control 'x' from y.ocx. Your version of y.ocx may be outdated. Make sure you are using the version of the control that was provided with your application."
-
Aug 2nd, 2021, 11:07 AM
#2
Re: VB 372 error : Failed to load control y from x.ocx. Your version of y maybe outda
The file version number of the OCX doesn't mean much. It really only exists for the use of deployment tools, and for it to have real meaning discipline is required.
What has probably failed is a mismatch of the interfaces implemented by your OCX. These are reflected by typelib's version, something entirely different. Type libraries are identified via a GUID, locale ID, and major/miner version numbers.
Of course the typelib is only used for development and compilation. Type information is compiled into the program. In a sense they are predigested source code, analogous to a C header file.
So your program was probably compiled against different interfaces from the ones actually implemented in the OCX that gets found at run time.
That shouldn't be erratic (sometimes working, sometimes failing) but there are things that can cause this. For example an improper installer that results in a mishmash of versions, for example a local machine copy and virtualized copies that are different for each of one or more users.
The best way to avoid that is to avoid having your program treated as "legacy" via a manifest that (at least) contains a proper trustInfo section. That and to use a proper installer for any updating of the OCX: 1. must run elevated, 2. must check for an existing older version, 3. if found uninstall the old and install the new.
An alternative might be to use an isolation manifest to avoid the need to register the OCX. Of course that also means you must recompile your program if the OCX changes, generate a new manifest with the new OCX's type information, embed the new manifest in the EXE. You must also avoid placing the OCX in the same folder as the EXE (for example place it in a subdirectory pointed to by the manifest) or else the VB6 runtime may attempt to register it. Result: more chaos.
Once you've let this happen it can be messy to clean up. You might have copies of different versions and their registry entries all over the place: local machine copy and different virtualized copies for each user on the machine.
-
Aug 3rd, 2021, 11:07 AM
#3
Re: VB 372 error : Failed to load control y from x.ocx. Your version of y maybe outda
We have a production level application that has been plagued with problems like this for 15+ years plus. We learned to live with and these days our solutions are much like people used to do back in the day with those old TV sets, we just hit it until it works. The application is long overdue for a complete rewrite in a modern framework(We're considering Odoo right now). COM binaries like OCXes their DLL counterparts are just clumsy as hell to work with. You screw it up once, and you could be paying for it for years if you don't nip it in the bud.
-
Aug 3rd, 2021, 01:16 PM
#4
Re: VB 372 error : Failed to load control y from x.ocx. Your version of y maybe outda
Originally Posted by Deeps008
The ocx file and the control are my own custom controls.
If this is actually true, and you have the source code to everything, one easy solution is to just pull the OCX's source code into your main project's source code, and then compile it as all one project ... thereby forgetting the external OCX files.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Aug 3rd, 2021, 01:28 PM
#5
Re: VB 372 error : Failed to load control y from x.ocx. Your version of y maybe outda
Originally Posted by Elroy
If this is actually true, and you have the source code to everything, one easy solution is to just pull the OCX's source code into your main project's source code, and then compile it as all one project ... thereby forgetting the external OCX files.
Yea, this would be the most painless solution.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|