Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / June 2007



Tip: Looking for answers? Try searching our database.

Failed to load control from OCX

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carlo - 30 May 2007 20:16 GMT
I have a project with several custom controls. I had to remove all
dependencies and start all components at version 1.0. I have created a new
package with the 'Package & Deployment Wizard'. The application works fine
on the development machine, however on the test machine that does not have
VB installed, I get an error message on execution. "Failed to load control
'abc' from OCX, Your version of OCX may be outdated. Make sure you are using
the version of the control that was provided with your application." I have
cleaned the registry and checked the LIBIDs for the controls in the VBP and
form files that use these controls and they all match the LIBIDs in the Type
Library (I am using OLE viewer) on the Test machine. How can it be it is
still looking for an other version?
MikeD - 30 May 2007 22:11 GMT
>I have a project with several custom controls. I had to remove all
>dependencies and start all components at version 1.0. I have created a new
[quoted text clipped - 7 lines]
>the Type Library (I am using OLE viewer) on the Test machine. How can it be
>it is still looking for an other version?

That error can be quite misleading.  As just an example of how misleading,
see this:

PRB: Run-Time Error 372 Occurs with the ImageList Control in Microsoft
Visual Basic 6.0
http://support.microsoft.com/kb/818616/en-us

Did you also recompile your application(s) that use these controls? Just a
guess, but perhaps the controls' version information gets compiled into the
EXEs and since your controls now have apparently a lesser (or "older)
version number, you're getting this error.  That's just a guess. But if you
haven't recompiled your EXE, that's the first thing I'd attempt to fix this.

Signature

Mike
Microsoft Visual Basic MVP

news.microsoft.com - 31 May 2007 14:15 GMT
Thanks Mike,

Yes, I did recompile, I also tried to copy the exe from the dev box (same
file size/date). The .frm files are the only files refering to the controls
and these have the correct guids. All the ocx and dll files are the same
file size/date, un and reregistered them, does not make a difference. I am
really puzzled. It has to be something else inside the registry, maybe not
in the type library...

>>I have a project with several custom controls. I had to remove all
>>dependencies and start all components at version 1.0. I have created a new
[quoted text clipped - 21 lines]
> you haven't recompiled your EXE, that's the first thing I'd attempt to fix
> this.
MikeD - 31 May 2007 20:38 GMT
> Thanks Mike,
>
[quoted text clipped - 4 lines]
> difference. I am really puzzled. It has to be something else inside the
> registry, maybe not in the type library...

No, it doesn't have to be something related to the Registry. In the KB
article I mentioned, the problem has nothing to do with the Registry.  It
has to do with icons and their color depths being higher than Windows is
configured to display.

Signature

Mike
Microsoft Visual Basic MVP

>>>I have a project with several custom controls. I had to remove all
>>>dependencies and start all components at version 1.0. I have created a
[quoted text clipped - 21 lines]
>> you haven't recompiled your EXE, that's the first thing I'd attempt to
>> fix this.
Carlo - 01 Jun 2007 13:56 GMT
Mike,

Good suggestion. However the color depth is not the problem here, my test
machine has a 32 bit color setting and my icons have a very low color depth,
and are actually quite crappy and unprofessional looking. I appreciate your
feedback. Will post the solution when I find it. Thanks.

>> Thanks Mike,
>>
[quoted text clipped - 36 lines]
>>> But if you haven't recompiled your EXE, that's the first thing I'd
>>> attempt to fix this.
Ken Halter - 31 May 2007 21:18 GMT
> Thanks Mike,
>
[quoted text clipped - 4 lines]
> difference. I am really puzzled. It has to be something else inside the
> registry, maybe not in the type library...

Wanna fix that? In almost every case I've seen, the problem is caused by
outdated OCA files... so, search your entire drive for OCA files and delete
every one of them. Now, run RegClean to clean up the left over garbage,
then, rebuild your control, package and deploy. Birds will sing, flowers
will bloom <g>

OCA files are temporary typlib caches and they are "brittle". I would be
nice if VB deleted them when you leave the IDE, but we have what we have,
so....

Signature

Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm

The Peasant - 01 Jun 2007 10:25 GMT
I agree about the OCA files - delete the lot.  But do search for multiple
instances of OCX files as we had an instance where a rogue OCX was left
elsewhere on the path and was used by the system.

If all else fails, try VB Powerwrap to wrap all files within the EXE.
After 6 weeks of tearing hair, this has worked a treat for the last 12
months.

http://www.moonlight-software.com/vbpower.htm

The Peasant

>> Thanks Mike,
>>
[quoted text clipped - 14 lines]
> nice if VB deleted them when you leave the IDE, but we have what we have,
> so....
Carlo - 01 Jun 2007 14:17 GMT
Ken,

Did that, there are no OCA files to be found on my system. I noticed the
Microsoft RegClean does not clean all the OCA references out of the
registry. I have been using a custom cpp application to clean up these
references. Still no luck. I have checked for double OCX files in the system
path. Nothing... I;m not giving up, will let you know what I find. Thanks!!

>> Thanks Mike,
>>
[quoted text clipped - 14 lines]
> nice if VB deleted them when you leave the IDE, but we have what we have,
> so....
Carlo - 04 Jun 2007 20:58 GMT
And the solutions is...

My ocx uses an other ocx to read weight from a scale, this component used
the Microsoft "mscomm32.ocx" for communication through the com-port.
However, this component is from 1998, and was not on the test machine. No
idea why it didn't come over with the deployment package though...
Nevertheless, problem solved. Thanks for all your input. I really appreciate
it!

Carlo

>I have a project with several custom controls. I had to remove all
>dependencies and start all components at version 1.0. I have created a new
[quoted text clipped - 7 lines]
>the Type Library (I am using OLE viewer) on the Test machine. How can it be
>it is still looking for an other version?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.