Question

In the system32 directory I saw an .OCX file with a corresponding .OCA file.

I had thought .OCA files are used only by Visual Basic. Are they therefore unnecessary for program execution and could be removed?

If they are unnecessary, why would there be an .OCA in the system32 folder in the first place?

Was it helpful?

Solution

.OCA files serve as a cache of the extended type library information for its corresponding .OCX file.

If you delete an .OCA file for a control VB recognizes and uses, VB will recreate the .OCA file when you load a project requiring the control. The recreation process takes a little time but comes with no penalty otherwise.

Last reviewed: April 4, 1996

Article ID: Q149429

SUMMARY For every custom control file (.OCX) that Visual Basic uses, there is an accompanying .OCA file of the same file name. For example, GRAPH16.OCX has an accompanying .OCA file called GRAPH16.OCA. An .OCA file is a binary file that functions as both an extended type library file and a cache for the custom control file.

MORE INFORMATION

A type library is a file or component within another file that contains OLE Automation standard descriptions of exposed objects, properties, and methods. The actual working type library for a custom control used in Visual Basic is a combination of the type library of the control itself and the additional properties provided by the framework that wrap the control.

Some of the properties of the control are provided by the framework and some by the control itself. Programmatically, the properties from the framework and the control all appear as properties of the control.

In order for these properties to appear, Visual Basic creates an extended type library when the control is loaded into the toolbox. Because the process of reading the control's type library and creating the extended type library is time consuming, Visual Basic caches the extended type library information into an OCA file.

If you delete the OCA file for a control Visual Basic recognized, Visual Basic will re-create the .OCA file when you load a project requiring the control. This re-creation process comes with a time penalty.

(http://support.microsoft.com/kb/149429)

So, don't worry about including them when you deploy your application.

OTHER TIPS

Sorry to resurrect a zombie thread, but I want to summarize to make sure I understand this. An OCA file is only needed during compilation of a program and if it is missing, VB will create what it needs so all that is lost is time during compiling. Unless you have really sloppy programming and another homemade dll or ocx needs a particular oca. If an oca is shipped with a product, it should be able to be safely deleted.

No, they are not necessary for it to execute but they are necessary for the program to run properly (if the program required the file in the first place).

They never need to be deployed with a finished program for it to run.

This could be a dumb attempt to answer, but you could simply rename the file and see if the application quits working. If so, those files are necessairy.

DNA-science is about the same:
Remove a gene and see what stopped "working". De facto, this gene is related to / necessairy for that body-part or whatever.

Re: No, they are not necessary for it to execute but they are necessary for the program to run properly (if the program required the file in the first place).

Since execute and run mean the same thing - what you are saying is that: it's not required for it to run but it's required for it to run properly?? or alternately it's not required for it to execute but it's required for it to execute properly??

I am suspecting that the *.OCA files are not required EXCEPT for compiling a program using VB and if they don't exist when you load a project then VB will create any missing OCA files automatically in order to speed up future load or compile operations in VB.

I just deleted EVERY OCA file off my system (I'm a brave man when I'm using a cloned virtual machine to do this). I then rebooted and ran my software and it worked just fine without ANY OCA files on my entire system. Now it might take a bit longer to load/compile my programs next time as vb will regenerate the OCA files but I'm using an i7 with 16Gb of RAM and an SSD so who cares!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top