开发者

How to create overloading functions in Visual-C++ library (.net)?

开发者 https://www.devze.com 2023-01-13 03:57 出处:网络
So what I want is to create 3 functions with same names but taking difrent arguments (one will take 2 and others one lats say System::String). (I will compile tham into .net library from visual-C++, c

So what I want is to create 3 functions with same names but taking difrent arguments (one will take 2 and others one lats say System::String). (I will compile tham into .net library from visual-C++, create a c# project, connect my lib to it and want开发者_如何学编程 to be able to see in my library one function name which would have 3 overloads.)

How to do such thing in VS C++ 2010


ref class SampleClass
{
public:
    SampleClass(){}
    void Set(int value){}
    void Set(String^ value){}
    void Set(int value1, String^ value2){}
    ...
};

Build this as .NET Class library, and add reference to it in C# client project.


Declare three functions with the same name and different parameters.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号