How to compile and register COM components of. net

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.