This article does not involve any explanation of the technology of COM, just to say how to write a good DLL form of COM how to use. As shown, I already have a COM server in the form of a DLL and a COM client that uses a COM server:
Now this DLL's COM server to register in the operating system, so that every time the use of the COM library to know where to load this COM server.
The tool used to register the DLL's COM server is regsvr32.exe this thing, and its directory is the C-drive under the Windows\System32.
Grammar:
regsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllname where dllname is the file name of the ActiveX control, it is recommended that you copy it to the System folder before installation. However, there will always be an error, saying that the corresponding module can not be found.
registration is not successful may be that the DLL file can not be copied separately to register, but to use the DLL file is located in the Software installation path to register. Locate the file path under the Software installation directory where the file is located .
In DOS, enter the command Regsvr32+dll file full path (the path under the installed software directory), and then enter, you can complete the DLL COM server registration.
Note Select the file location of the DLL's COM server.
COM programming-Registering a COM server in the form of a DLL