0
votes

I am working on C++/CLI Wrapper for C Static Library.Static Library has 10 function in it.

THis C++/CLI Wrapper will Expose 10 API to C# Application.The Wrapper Will be in the Form of dll.

The Wrapper Will be Used in C# Application.

Now I am trying to add a class in C++/CLi application which will expose function to C# application I am getting Many Option like

  1. C++ Class

  2. CLR Class
    a. Component Class
    b.Installer Class
    c. Windows Form d. Installer Class

I am bit confused which I need to select out of it as I am new bee in C++/CLI

2
Are you talking about the new class wizard ? Ditch this, you only need three lines to declare the class. Read about C++/CLI there: functionx.com/cppcli/index.htmAlexandre C.

2 Answers

1
votes

You need a

CLR Class - Component

since it can be consumed by .NET clients. CLR class is declared as follows

ref class Wrapper {....}

However in your scenario you could also write a dynamic library and pinvoke the methods from .NET client.

1
votes

Not sure if your question has been entirely answered, but a Component class creates a class that implements an IComponent interface for remoting/ inter process communication purposes. Didn't seem like what you were looking for.

I think what you were looking for i just a "template" to create a managed class? In that case all you need to do is select C++ in the wizard and make sure the "Managed" check box on the right hand side is selected.