NET in the call to DCOM

Source: Internet
Author: User
Tags interface
NET in the call to DCOM
Originally thought C # can not call DCOM, now only found that can, write out, hope for everyone to help
I tuned the DCOM is written in Delphi, remote server IP is 192.168.0.1 called DCOM has the implementation interface of the class is dcomclass,clsid={2e2c947f-9a08-4839-a05d-05021722d30c}
The local DCOM file DCOMCLASS.TLB contains the DCOM interface and the implemented class
Here we go.
1. Make sure the dcomclass.tlb is registered on your local machine (regsvr32)
2. Add references to dcomclass.tlb in the project
3. Write the following code call, the code is very simple
System.Guid guid=new Guid ("Bb7b3214-03d7-11d6-aee1-52544c1b3ff5");
System.Type T=type.gettypefromclsid (GUID, "192.168.0.1", true);
Object Comobject=system.activator.createinstance (t);
Dcomclass myclass= (dcomclass) comobject;
OK, now you can use the ...
(Attach, also can pass ProgID to adjust, I here of DCOM all do not have this thing, you can try)



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.