What are the differences between ActiveX, Ole, COM, ocx, and DLL?

Source: Internet
Author: User
Tags activex update

People familiar with object-oriented programming and network programming must be familiar with ActiveX, Ole, and COM/DCOM concepts, but the relationship between them is still vague to many. The difference between components and objects should be clarified first. A component is a reusable module that consists of a set of processing processes, data encapsulation, and user interfaces (rules object ). The component looks like an object, but does not conform to the academic Definition of the object. The main differences between them are: 1) components can be used in another application called a container (sometimes called a container or host) or as an independent process; 2) A component can be composed of one class, multiple classes, or a complete application. 3) the component is reused by the module, and the object is reused by the Code. Currently, popular component models include COM (Component objiect module, object component model), DCOM (Distributed COM, distributed object component model), and CORBA (Common Object Request Broker Architecture, public Object Request proxy architecture ). At this point, the topic com related to this article has appeared, while the topic "CORBA" has nothing to do with this article and will not be introduced. Starting from the difference between components and objects, we want to make it clear that com and CORBA are at the bottom of the entire architecture. If you still cannot understand this, let's continue to look at it, finally, you will naturally understand it after looking back. Now we will describe the relationship between ActiveX, Ole, and COM. First, let everyone have a general concept. From the perspective of time, Ole was first introduced, followed by COM and ActiveX. From the perspective of architecture, ole and ActiveX are built on com, so COM is the foundation. From the perspective of name, Ole and ActiveX are two trademark names, while com is a pure technical term, this is also why we hear more about ActiveX and Ole. Since Ole was the first to appear, from Ole, since the Windows operating system became popular, "Clipboard" (Clipboard) first, the communication between different programs is solved (the clipboard is used as the data exchange center for copying and pasting), but the clipboard transmits "dead" data, application developers have to write and parse code in the data format themselves, so the communication protocol of Dynamic Data Exchange (DDE) came into being, it allows applications to automatically obtain the latest data from each other, but solving the "Data Format" Conversion between each other is still a heavy burden on programmers. The birth of Object Linking and embedded (OLE) raised the data exchange of the original application to "Object Exchange ", in this way, both the data and the application objects of each other can be obtained between programs, and the data content of each other can be directly used. In fact, Ole is Microsoft's composite document technology, its original version only targets compound documents, but in later versions of ole2, it imports COM. It can be seen that com was born based on the needs of OLE, so although COM is the foundation of Ole, ole was generated before COM. The basic starting point of COM is to allow a software to provide services for another software through a common institution. COM was born according to the needs of OLE, but its first user is ole2. Therefore, COM and composite documents have little relationship. In fact, later, COM was widely used as a technology that has nothing to do with composite documents. In this way, Microsoft began to "color finger" general platform technology. However, COM is not a product and requires a trademark name. At that time, Microsoft's market experts had chosen Ole as the trademark name, so the COM technology began to be labeled with Ole. Although most of these technologies have nothing to do with composite documents. Microsoft's practice leads to the misunderstanding that ole only refers to compound documents? Or is it not just a single compound document? In fact, Ole is the trademark name of COM, not just a composite document. However, Microsoft may not be able to explain it clearly. It takes considerable effort and time. As a result, with the development of Internet, Microsoft changed its mind in the spring of 1996 and chose ActiveX as the new trademark name. ActiveX refers to a loosely defined and com-based technology set, while Ole still only refers to composite documents. Of course, the core technology of ActiveX is com. The biggest difference between ActiveX and Ole is that ole is aimed at the integration between application software and files on the desktop, while ActiveX focuses on providing further network applications and user interaction. Here, we should have a clear understanding of the relationship between ActiveX, Ole, and COM. com is the most fundamental core technology, so the following focuses on com. It is a novel idea to make the object model completely independent from the programming language. We can understand this in terms of the concepts of C ++ and Java objects. But what is the so-called COM object? For ease of understanding, we can regard com as a certain (software) packaging technology, that is, regard it as a different part of the software, according to a certain object-oriented form, combine them into processes that can interact with each other and use groups to support databases. COM objects can be written in any language, such as C ++, Java, and VB, and can be implemented using DLL or as an execution file for different process work. When using a COM Object Browser, you do not need to worry about the language in which the object is written, or whether it is executed in a DLL or another process. From the browser side, there is no difference. Such a general processing technique is very useful. For example, the two applications run in coordination by the user can use their common job parts as the interaction between COM objects (of course, the current Ole composite document can also do ). To execute the code downloaded from the web server in the browser, the browser can regard it as a COM object, that is, COM technology is also a standard method for packaging downloadable code (ActiveX controls execute this function ). You can even use com to specify the method for interacting with the local OS. For example, a new API is used in windows and Windows NT, most of which are defined as COM objects. It can be seen that although com originated from the composite document, it can be effectively applied to many software problems. After all, it is a basic technology at the underlying layer. In a word, COM is a language-independent component architecture that allows components to communicate with each other. With the development of computer networks, COM has been further developed into a Distributed Component Object Model. This is DCOM, which is similar to orb of CORBA. This article will not elaborate on this. I believe that you will have a clear understanding of the relationship between ActiveX, Ole, and COM/DCOM.

Windows users must be familiar with ActiveX control. It provides a call similar to DLL dynamic link library, however, the only difference between ActiveX and DLL is that ActiveX is not registered and cannot be recognized and used by the system. So what should we do when we get a message that ActiveX is not correctly installed and cannot be used? 1.regsvr32 has a regsvr32.exe program under the systemfile folder of windows. It is an ActiveX registration and anti-registration tool provided by windows. You can also easily register ActiveX controls using regsvr32/u/s/n/I dllname, where dllname is the ActiveX control file name, we recommend that you copy the following parameters to the system folder before installation:/U-unregister control/S-whether the registration is successful or not, the prompt box/C-console output/I-Skip control options are not displayed for installation (different from registration)/n-do not register the control, this option must be used with the/I option. For example, I want to register an amovie. OCX control, enter regsvr32 amovie. OCX, you only need to use regsvr32/u amovie to register it. OCX is enough. 2. registry registration ActiveX is nothing more than recording some information in the Windows registry, such as Shockwave Flash objectcontrol. We can run the regedit.exe registry editing program and search by keywords, export the searched registry to a reg registry file, and then copy the corresponding activex file to the Windows system folder (generally, the activex file name is ocx, install it in the Windows system folder), and then double-click to import the exported registry file on the machine where ActiveX is to be installed to complete the installation.

ActiveX, Ole, and COM are some technical standards of Microsoft. Ole became ActiveX later, and then com OCX later. dll is the extension. ActiveX has two extensions: OCX and DLL. In fact, you can change the temporary extension names. Com, as an ActiveX update technology, may also contain DLL files or dynamic link libraries. It mainly loads some functions and can be dynamically loaded. From: http://hi.baidu.com/yaolihui/blog/item/aa9cfcce91931e0192457eb5.html

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.