Help with using c++ class called with P/Invoke

This is a discussion on Help with using c++ class called with P/Invoke within the C# Programming forums, part of the General Programming Boards category; Hi,
I've successfully been able to call C++ function into my C# ASP.NET application using P/Invoke. However, calling and using ...

Help with using c++ class called with P/Invoke

Hi,

I've successfully been able to call C++ function into my C# ASP.NET application using P/Invoke. However, calling and using c++ classesfrom my DLL has been quite troublesome. Here is a small example I'm working with:

As far as I can tell, there is no way to instantiate an object declared within the DLL ( I assume because of CLR typing - but if you know differently, I'd really really like to know how you do it!)

So I basically had to write wrappers within the DLL to achieve this effect. It certainly doesn't seem perfect to me, so please somebody show me more or give me some pointers, I really need to know everything I can about marshalling data using P/Invoke.