[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Why does a VB6 exe load an .oca file instead of .ocx file?

Posted on 2011-05-08
Medium Priority
Last Modified: 2012-05-11
I am trying to create a distributable VB6 EXE. My predecessor had built an EXE that uses many custom ActiveX controls. If I recompile his code, and monitor the process with Process Monitor, the new EXE loads the .oca file of one such control instead of the .ocx file. I can see that the original exe that he built loads the .ocx file using its class id. But, if I recompile, my EXE loads the corresponding oca file instead. I have tried deleting all my oca files and used a registry cleaner, but once I re-open the vbp file to compile, the oca files are recreated. I even tried compiling using command line, but VB still creates the oca files when I do this.

I think I should be able to install the previous version of our application, and simply recompile the main EXE, and then be able to run that EXE on another machine that has the app installed, but since it is trying to reference the oca file which has a different registry id on the other pc, it will not run. My EXE is actually an ActiveX EXE.

Can anyone tell me what I am missing here? Or how to get by this issue? Is there some setting that tells VB to load ocx files instead of oca files?
Question by:kenalstom
  • 4
  • 2
LVL 76

Expert Comment

ID: 35716560
It's to save the application time. Otherwise it has to create one anew:

LVL 15

Expert Comment

ID: 35716569
Visual Basic creates an extended type library when the control is loaded into the toolbox.



Author Comment

ID: 35716617
I realize what an .oca file is and why it is created, but what I am trying to find out is why one EXE loads the .ocx and when simply recompiled, the new EXE loads the .oca file. I need to know the difference and why it happens in order to create a new EXE that will run on other machines (and always load the .ocx file).
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!

LVL 15

Expert Comment

ID: 35717631
Vb Ide generates the .oca file when you presents it on a designer.
.oca is a expanded .ocx generated for performance to access .ocx properties.
.ocx is used when you executes the program without Vb. Ide.

Accepted Solution

kenalstom earned 0 total points
ID: 35720970
VB6 with SP3 must have had a bug. Even when running outside the IDE, my EXE was loading the oca file instead of the ocx. I upgraded to SP6 and it seems to have fixed things.

Author Closing Comment

ID: 36123240
After reading some online articles I noticed some mentioned service packs, so I tried the latest and it fixed things.

Author Comment

ID: 36097865
No objections. I was just trying to get this question closed somehow.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
Suggested Courses
Course of the Month18 days, 22 hours left to enroll

834 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