How to compile and register the. net com component [add this page to favorites] [print]:
Itpub Forum 2008-05-20
Content Navigation:
Overview
Page 1: Overview
[It168 technical documentation]
COM + components were popular in the Age of VB6.0 and VC ++. Currently,. net
The component system of the framework has gradually replaced the position of COM + because it does not require registration. However, some systems still need the support of COM + due to historical problems. it is also very simple to compile COM + components in. net.
In vs2003, to generate COM + components, there is actually only one additional task, that is, to project as shown in,
There is no difference between other parts of the program and other parts.
Focuses on how to register COM + components written by. net
There are some sayings on the Internet, but I did not succeed according to the operations, orProgramPermission issues occur during access. In fact,. net
You cannot directly use regsvr32.exe to register the written compose. As a result, the system will lack metadata and we need to use. Net first.
The regasm tool provided by framework writes the metadata required by the COM component to the Registry. The registry allows com client programs to create. NET Framework transparently.
Class. Once the class is registered, any COM Client program can use it, as if the class is a com
Class. In the compiled directory, the COM component generates a. TLB file with the same name. The regasm usage is as follows: regasm/TLB: encrypter. TLB
Encrypter. dll. This step is indispensable after my experiment.
Then, you can use the component service
The COM component is set to com service. During the setting process, pay attention to the permission setting.
TLB files are described as follows:
TLB is an OLE (or
ActiveX) definition file, which includes the definitions of constants, interfaces, and classes. You can select
Add the TLB file to the project, and then
Browser, You can see which constants, interfaces, and classes are included in the file, and what methods and attributes are included in each class. The various sdks provided by Microsoft usually include one or several TLB files for easy programming. You can also create a TLB file. First, compile an odl file (with syntax instructions in the help of VC ++), and then compile and generate a TLB file using mktyplib (available on the VB disc. Similar files include olb files provided by office.