.OCA 文件是程序执行所必需的吗?
在 system32
目录中,我看到一个 .OCX
文件以及相应的 .OCA
文件。
我原以为 .OCA
文件仅由 Visual Basic 使用。因此它们对于程序执行来说是不必要的并且可以被删除吗?
如果没有必要,为什么 system32
文件夹中会有 .OCA
呢?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
.OCA
文件充当其相应.OCX
文件的扩展类型库信息的缓存。如果删除 VB 识别和使用的控件的
.OCA
文件,当您加载需要该控件的项目时,VB 将重新创建.OCA
文件。重新创建过程需要一点时间,但不会有任何惩罚。(http://support.microsoft.com/kb/149429)
所以,不用担心关于在部署应用程序时包含它们。
.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.(http://support.microsoft.com/kb/149429)
So, don't worry about including them when you deploy your application.
很抱歉复活了一个僵尸线程,但我想总结一下以确保我理解这一点。
OCA 文件仅在程序编译期间需要,如果缺少该文件,VB 将创建它需要的文件,因此损失的只是编译期间的时间。除非你的编程非常马虎,并且另一个自制的 dll 或 ocx 需要特定的 oca。
如果 oca 随产品一起提供,则应该能够安全地删除它。
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.
这可能是一个愚蠢的回答尝试,但您可以简单地重命名该文件并查看应用程序是否停止工作。如果是这样,那么这些文件是必要的。
DNA 科学大致相同:
删除一个基因,看看是什么停止了“工作”。事实上,该基因与该身体部位或其他部位相关/是必需的。
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.
回复:不,它们不是执行所必需的,但程序正常运行是必需的(如果程序首先需要该文件)。
由于执行和运行意味着相同的事情 - 你所说的是:
它不需要它运行,但它需要它正常运行?
或者交替地
它不需要它执行,但它需要它正确执行?
我怀疑 *.OCA 文件不是必需的,除非使用 VB 编译程序,如果加载项目时它们不存在,那么 VB 将自动创建任何丢失的 OCA 文件,以加快将来的加载或编译操作在VB中。
我刚刚删除了系统中的所有 OCA 文件(当我使用克隆虚拟机执行此操作时,我是一个勇敢的人)。
然后我重新启动并运行我的软件,它运行得很好,整个系统上没有任何 OCA 文件。现在,下次加载/编译我的程序可能需要更长的时间,因为 vb 将重新生成 OCA 文件,但我使用的是带有 16Gb RAM 和 SSD 的 i7,所以谁在乎呢!
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!