简体   繁体   中英

How would you pass an C# object via com?

How would one pass a C# object via com? For example, say I have the following in ac# dll which is registered in the GAC and registry:

 public int Add(int a, int b)
    {
        return a + b;
    }

public int Add(NumberObject obj)
    {
        return obj.firstNumber + obj.SecondNumber;
    }

How is it possible to make the NumberObject comvisible so that the client, who is going to use this, can set its values? A c++ example would be great, is it even possible? Or are only native types like int, string etc passable by COM?

一个好教程

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM