Through the previous study and practice, we have learned how com is and how to call COM components.
To sum up, COM is the component object model, which means that the COM Object and COM class are different from the objects and classes in C ++, VB, or Delphi, COM Object and COM class are independentProgramming LanguageAnd has a set of memory layout specifications, so Binary-level Functional Reuse can be achieved. The purpose of COM is to reuse modules across programming languages and development platforms. (Although currently. the net platform solves the reuse of modules between different programming languages, such as VB.net and C #. net, but the reuse is based on Microsoft intermediate language, not localCodeLevel. NET Framework is actually a runtime)
The previous call to the Windows Shell Interface shows how the client calls the COM Service. It can be seen that the interface provided by Windows shell is the standard COM interface, which can be easily used for shell programming, shell programming is interesting. You can customize the operating system through the interface provided by the operating system, but there are not many official shell interfaces provided by the Windows operating system platform.
1. First, use the coinitialize function to initialize the com environment, return hresutl, and use succeded or failed macro to check whether the initialization is successful.
2. Use the cocreateinstance function to create a component object you want and assign an interface to you.
3. Use this interface to perform operations. If you want to use other interfaces, you can use QueryInterface to query other interfaces.
4 uninitialize () uninstall the com Environment