Because Com Components and . Net Components depend on different internal structures, so they are inherentlyIncompatible. But fortunately Microsoft Company in . Net SDK Some tools are provided. . Net Component generation Com Proxy, or Com Component generation . Net Agents, with these agents and other technologies, each company can . Net Used in the project Com And you can . Net ApplicationProgramUsed in . Net Component.
Static Link
CodeIn the early stage of program development, developers need to use# IncludeStatement to connect the library file with the main program file. After compilation, the utility function and the program that calls the utility function are statically linked together to form an executable file!
Two defects of static links:
1Because it sends the same function to multiple executable files, the storage space is greatly wasted.
2If an error is found in one of the functions, you must re-compile and re-release each executable file that calls the function.
Dynamic Link
To avoid this problem, developers compile the function library into an independent binary file, and each executable file can be dynamically linked to those binary files. In this way, several executable programs can share the same binary library file, that is, the dynamic link library.(DLL). To modify a utility, you only need to re-releaseDLLInstead of re-Compiling and releasing all executable files that call functions.
Although DLL It is very convenient and effective, but it has a major drawback: DLL Is related to a specific language, that is C Source codeCompiled DLL Only C Client program reference.
ComIt refers to the component object model.(Component Object Model)
Com This is the result of the evolution of code reusability. Use Com , Which can be used by programmers C ++ And compile the library. Then, you can Com Compatible languages ( For example Dephi Or Visual Basic And so on ) Use the class in the library. Com Is a more basic technology than other technologies, such Ole (Object Linking and Embedding) And ActiveX Controls, etc!
COM + services
COM + services Yes Com The latest version of technology, COM technology Initial cause Microsoft Transaction Server Well-known. Now, COM + services Yes Windows2000 A component of the operating system. Com The component can be called. Windows2000 Operating system to meet the general functional needs of components.
The above text is taken from 《C #Advanced Programming