今天试图打开一个很久没有用过的软件,但是系统却报错,说
Component ‘COMDLG32.OCX’ or one of its dependencies is not correctly registered: a file is missing or invalid.
COMDLG32.OCX到底是什么呢?我在网上所搜了一下,然后在Yahoo answers上找到这个答案
OCX - an Object Linking and Embedding (OLE) custom control.
An OCX is an Object Linking and Embedding (OLE) custom control, a special-purpose program that can be created for use by applications running on Microsoft's Windows systems. OCXs provide such functions as handling scroll bar movement and window resizing.
If you have a Windows system, you'll find a number of files in your Windows directory with the OCX file name suffix. Object Linking and Embedding was designed to support compound documents The Windows desktop is an example of a compound document and Microsoft used OLE to build it. OLE and the Component Object Model , a more general concept that succeeded OLE, support the development of "plug-and-play" programs that can be written in any language and used dynamically by any application in the system. These programs are known as components and the application in which they are run is known as a container. This component-based approach to application development reduces development time and improves the program capability and quality.
Windows application development programs such as PowerBuilder and Microsoft Access take advantage of OCXs. Microsoft now calls an OCX an ActiveX control, the component object under Microsoft's set of ActiveX technologies, of which the fundamental concept is the Component Object Model and, in a network, the Distributed Component Object Model (DCOM). An OCX or ActiveX control is actually implemented as a dynamic link library DLL module. (You can think of a DLL program as a "subprogram" that can be used by any number of application programs, each of which is a "container" for the DLL or OCX/ActiveX control "object.") Visual Basic and C++ are commonly used to write OCX or ActiveX controls.
You need to install the ocx file because it might be corrupted.
Visit this page to learn more and download and how to install ocx files
http://windowsxp.mvps.org/comdlg32.htm
Comdlg32.ocx file information
CompanyName: Microsoft Corporation
FileDescription: CMDialog ActiveX Control
DLL FileVersion: 6.00.8877
InternalName: CMDIALOG
LegalCopyright: Copyright © 1987-2000 Microsoft Corp.
OriginalFilename: COMDLG32.OCX
ProductName: CMDIALOG
ProductVersion: 6.00.8877 Comments: May 26, 2000
咳,大长篇,看得我似懂非懂的,总之我的理解就是这个叫做COMDLG32.OCX的系统文件是运行一些软件所必须的,现在这个文件除了故障,那简单直接的办法就是找一个正常的文件来盖过之前的就好。以下是从Developer Onenote上找到的解决办法,http://devonenote.com/2010/02/register-comdlg32-ocx-on-x64-win7/
Here is how to resolve comdlg32.ocx missing error.
- Download comdlg32.zip and extract comdlg32.ocx from zip file
- Move comdlg32.ocx to c:\Windows\system32 folder. For 64bit Vista/Win7, move comdlg32.ocx to c:\Windows\SysWOW64
- Open a command line window and run following command:
regsvr32 c:\Windows\system32\comdlg32.ocx
Note: a) On 64bit Vista/Win7, run this command instead:
regsvr32 c:\Windows\SysWOW64\comdlg32.ocx
b) For Vista/Win7 with UAC turn on, the above command needs to be run from elevated command prompt.
- Once comdlg32 is registered successfully, following message will prompt, DllRegisterServer in C:\WINDOWS\System32\comdlg32.ocx succeeded.
- Now launch the application again you should not see file missing error.
Update: Important note if you use WIN7: when registering comdlg32.ocx, it must be done as administrator, or regsvr32.exe will failed with error 0x8002801c.
To do this as administrator, Go to ‘All Programs -> Accessories -> Command Prompt’, right click on ‘Command Prompt’ icon, and click on ‘Run as administrator’ to start a command prompt, then run the regsvr32 command
按照上面的步骤操作之后,问题就解决了,软件也能正常运行了。但是需要注意的是,我也无法确定网上下载的COMDLG32.OCX是否对系统有什么不好的影响,所以建议先备份原先的文件,例如我的做法就是直接将其改名为COMDLG32.OCX.bak。以后如果有问题,可以找到这个备份文件,还原操作。