This is more or less a duplicate of Importing a C++ dll in C# however that question has some poor "information lite" answers.
Unfortunately there is no short answer to this, however you do have several options.
- Wrap your C++ class in a managed C++
class. Then your C# project just
references the managed C++ project,
and everything works.
- Like 1, create a managed C++ class,
but create a facade. This a
simplified interface to your class
exposing only the functionality you
need.
- The other approach is to use PInvoke
to call the methods on the class.
You'd need to built a C#
representation of the class for the
pinvoke calls. This can be
problematic and involves a lot of
trial and error if you don't know
what you're doing.
All of the above involve learning some technologies that will be new to you (manged C++ or the intracies of PInvoke). Unfortunatly there's no other way.
If you can I'd go with 2.