dr_rk
dr_rk

Reputation: 4565

C# wrapper around native C++ class

I have three native C++ classes with this relationship:

A <- B <- C 

where A <- B means class B instantiates and uses pointers to class A.

I wish to write a C# wrapper around class C so that its functions can be invoked from C#.

My question is do I need write wrappers for class A and class B as well? Note, classes A,B,C are all compiled as a static library in .lib file.

Upvotes: 0

Views: 713

Answers (1)

Steve Townsend
Steve Townsend

Reputation: 54178

C can continue to call B/A directly in native mode. You only need to handle native/managed interop on the surface area of your class(es) that are called directly from managed code.

Upvotes: 1

Related Questions