Look at a small meeting COM make notes

xiaoxiao2021-03-06  40

Because I want to be an ActiveX, I think that the last time ActiveX is two years ago. I took the "Delphi5 Developer Guide" again to see the com / ativex chapter, recorded the front, The back is mainly based on an example, it will not be remembered. Continue to look at Dotnet. What is the difference between COM, OLE, ACTIVEX? COM is a set of API and binary standards, which are cornerstones of other related technologies. OLE merely refers to techniques associated with object links and embedded, such as containers, servers, in place editing, drag and drop, and menu menu. ActiveX technology includes automation (previous OLE Automation) controls, documents, containers, scriptization, and several Internet technology.

The term shared a large piece of data between the application is an OLE object, which can include an OLE object called an OLE container, and allows own data to be included in other applications, called an OLE server. A document containing one or more OLE objects is called a composite document. A document can contain an OLE object or contain a complete application, which is called an ActiveX document.

Thread mode Each COM object is in a specific thread mode. The thread mode determines how an object is manipulated in a multi-threaded mode environment. Remember, just select a thread mode in the relevant wizard, and cannot guarantee that the COM object must be secure in that thread mode, you must write code yourself to ensure that the COM server works normally in the specified thread mode. This also needs to protect global variables or instance data in the COM object by means of thread synchronization objects.

Interface COM defines how the function of the function is in memory arrangement. These functions are arranged to VTABLE, similar to Delphi's virtual method table (VMT). The programming language is a so-called interface for each VTABLE.

In-Process COM Server IN-Process COM server is a DLL function that can create a COM object for host application. This type of COM server is called In-Process because the DLL function is in the same process of calling it. An in-process server must export the following four criteria entry point function: function DllRegisterServer: HResult; stdcall; function DllUnregsiterServer: HResult; stdcall; function DllGetClassaObject (const CLSID, IID: TGUID; var Obj): HResult; stdcall; function DllCanUnloadNow: HRESULT; STDCALL;

The Out-of-Process COM server OUT-OF-Process COM server is executable for use by other applications to create a COM object. The so-called Out-of-Process is because they are not in the same process with the client program, but their own procedures.

转载请注明原文地址:https://www.9cbs.com/read-70405.html

New Post(0)