Windows registers and cancels the registration of a DLL or OCX

Source: Internet
Author: User
Tags ole

Original: Windows registers and unregister a DLL or OCX

First, what is a DLL
DLL, is the short form of the dynamic link library, the Chinese name is the dynamically linked libraries.
A DLL is a library that contains code and data that can be used by multiple programs at the same time, and the DLL is not an executable file. Dynamic linking provides a way for a process to invoke a function that is not part of its executable code. The executable code of the function is in a DLL that contains one or more functions that have been compiled, linked, and stored separately from the processes that use them. DLLs also help to share data and resources. Multiple applications can access the contents of a single copy of a DLL in memory at the same time. A DLL is a library that contains code and data that can be used by multiple programs at the same time.


Second, what is OCX

OCX is the abbreviation of the OCX control. The OCX control is full name for the Object category expansion component (Object linking and Embedding (OLE) control eXtension). Its role in fact and just talked about the DLL file particularly similar, in fact, so-called OLE we are usually very familiar with, simply like in Word can use Excel data, WordPad can embed picture files and so on these features. For example, the Clipboard is like a simple data share, and OLE is an "object share."

The essence of the control is Microsoft's object linking and embedding (OLE) standard. Because it makes full use of the advantages of object-oriented, the program efficiency has been greatly improved, which has been widely used. There are many foreign companies that specialize in making all kinds of controls. The earliest form of a control is a. The format of the VBX appeared, and later became. Ocx.


Third, why to register DLL and OCX
If the DLL file or OCX file is not registered, the system registry does not have this DLL file or OCX file information. So wait until the call, because do not know this DLL file or the location of the OCX file, You can only report that there is no DLL or OCX file. So it's time to register the DLL.

DLL file or OCX file registration will generate the component's unique GUID number in the registry, the program refers to the component to find a DLL or OCX file, in order to use the DLL or the function of the OCX component


the "Tips" for Windows system DLLs because they are already registered at the time of installation, so do not register, but if the system does not recognize these DLL files because of some circumstances, still need us to manually register again.

c. Register or unregister DLL or OCX by command
Start-run--cmd and open the command-line tool.
Registration command: regsvr32 [DLL or OCX absolute path]the path can be copied, or you can directly drag the OCX or DLL files into the cmd window, automatically get the path, more convenient.
Unregister command: regsvr32/u [DLL or OCX absolute path]


iv. Add Right-click shortcut menu to register DLL or OCX
Often to register or cancel the DLL and OCX, always input the cmd command too cumbersome, so the new two right-click shortcut menu, more convenient.
1. Open the registry, open "Start/Run", and enter "regedit"
2. Add right-click to register DLL component shortcut menu open "Hkey_classes_root\dllfile", right-click "New Item", Create new Item "Shell" (if you already have one, do not create new), and then create a new "register" under the same method. where "Register" is the name of the item in the menu that pops up on the. dll or. ocx, and then "command" under it, double-click "Default" to change it to "Regsvr32%1".
3. Add right-click to unregister DLL component shortcut menu open "Hkey_classes_roor\dllfile\shell", right-click "New Item", New Item "Unregister". where "Unregister" is the name of the option in the menu that pops up on the. dll or. ocx, and then "command" under it, double-click Default to change it to "Regsvr32%1/u".
4, the same as the registration and cancellation of OCX, it is necessary to note that the above 2 and 3 "Dllfile" to "Ocxfile" can be.
5, Desktop F5 refresh. Find a DLL or OCX file, right-click to try it. How convenient!

6, solemnly declare: This method has a space in the path invalidation, such as the path name contains C:/Program files. Can only be done with the cmd command. (resolved by adding double quotation marks, e.g.)

[Hkey_classes_root\dllfile\shell\register Dll\command]
@= "Regsvr32%1"

Switch

[Hkey_classes_root\dllfile\shell\register Dll\command]
@= "Regsvr32 \"%1\""

7, as to delete the right-click menu, the registry to delete the corresponding item can be

Note: You can also copy the following files to Notepad and then save them as a . reg file to execute.

Add Right-click menu

Windows Registry Editor Version 5.00[hkey_classes_root\dllfile\shell\register dll\command]@= "Regsvr32%1" [HKEY_ Classes_root\dllfile\shell\unregister dll\command]@= "regsvr32/u%1" [Hkey_classes_root\ocxfile\shell\register OCX\ Command]@= "Regsvr32%1" [hkey_classes_root\ocxfile\shell\unregister ocx\command]@= "regsvr32/u%1"
Windows Registry Editor Version5.00[Hkey_classes_root\dllfile\shell\register Dll\command] @="Regsvr32 \ "%1\""[Hkey_classes_root\dllfile\shell\unregister Dll\command] @="regsvr32/u \ "%1\""[Hkey_classes_root\ocxfile\shell\register Ocx\command] @="Regsvr32 \ "%1\""[Hkey_classes_root\ocxfile\shell\unregister Ocx\command] @="regsvr32/u \ "%1\""  


Delete Right-click menu

Windows Registry Editor Version 5.00[-hkey_classes_root\dllfile\shell\][-hkey_classes_root\ocxfile\shell\]



Windows registers and cancels the registration of a DLL or OCX

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.