.OCA 文件是程序执行所必需的吗?

发布于 2024-09-29 12:29:06 字数 236 浏览 9 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

今天小雨转甜 2024-10-06 12:29:07

.OCA 文件充当其相应 .OCX 文件的扩展类型库信息的缓存。

如果删除 VB 识别和使用的控件的 .OCA 文件,当您加载需要该控件的项目时,VB 将重新创建 .OCA 文件。重新创建过程需要一点时间,但不会有任何惩罚。

上次审核时间:1996 年 4 月 4 日

文章 ID:Q149429

摘要 对于 Visual Basic 使用的每个自定义控制文件 (.OCX),
有一个具有相同文件名的附带 .OCA 文件。例如,
GRAPH16.OCX 有一个名为 GRAPH16.OCA 的随附 .OCA 文件。 .OCA
file 是一个二进制文件,既可以用作扩展类型库,也可以用作扩展类型库
文件和自定义控制文件的缓存。

更多信息

类型库是另一个文件或组件中的一个文件或组件
包含公开的 OLE 自动化标准描述的文件
对象、属性和方法。实际工作类型库为
Visual Basic 中使用的自定义控件是以下类型的组合
控件本身的库以及提供的附加属性
通过包装控件的框架。

控件的一些属性是由框架提供的
有些是由控件本身决定的。以编程方式,属性来自
框架和控件都显示为控件的属性。

为了显示这些属性,Visual Basic 创建了一个
当控件加载到工具箱中时扩展类型库。
因为读取控件的类型库并创建的过程
扩展类型库非常耗时,Visual Basic 会缓存
将类型库信息扩展为 OCA 文件。

如果删除 Visual Basic 识别的控件的 OCA 文件,
当您加载项目时,Visual Basic 将重新创建 .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.

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.

GRAY°灰色天空 2024-10-06 12:29:07

很抱歉复活了一个僵尸线程,但我想总结一下以确保我理解这一点。
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.

源来凯始玺欢你 2024-10-06 12:29:07

不,它们不是执行所必需的,但程序正常运行是必需的(如果程序首先需要该文件)。

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).

铁憨憨 2024-10-06 12:29:07

它们永远不需要与已完成的程序一起部署即可运行。

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

内心荒芜 2024-10-06 12:29:07

这可能是一个愚蠢的回答尝试,但您可以简单地重命名该文件并查看应用程序是否停止工作。如果是这样,那么这些文件是必要的。

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.

温柔少女心 2024-10-06 12:29:07

回复:不,它们不是执行所必需的,但程序正常运行是必需的(如果程序首先需要该文件)。

由于执行和运行意味着相同的事情 - 你所说的是:
它不需要它运行,但它需要它正常运行?
或者交替地
它不需要它执行,但它需要它正确执行?

我怀疑 *.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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文