.Net interoperability headache

This is a discussion on .Net interoperability headache within the C++ Programming forums, part of the General Programming Boards category; I got the notion to create a gui interface for some image recognition functions I wrote using the opencv library ...

.Net interoperability headache

I got the notion to create a gui interface for some image recognition functions I wrote using the opencv library in c++. My plan was to create my gui in c# and call my functions from my old c++ code.
Im hoping to learn more about the .Net framework and code interoperability.

However its not as straight forward as I thought, my reading on the msdn website has taken me down paths of learning about com,dll, data marhling and so on, my compiler has the same blank project opened on it for the last 3 days without taking a simple key input. Either interoperability is not as easy as I thought or Im off on a completely irrelevant tangent.

My questions are, is .Net really worth the hassel?
Is there any good structured material ,with good examples, showing this process, since all the information Im reading is from many different sources?
Does anyone have any links to a tutorial that gives an example of coding c++ code and calling it in c#?

What sort of parameters do your C++ functions take? Would you be passing image data or complicated image structures, or just driving some high-level functions? You need to put your native code into a DLL and then use the [DLLImport] attribute to bring into into .NET land. If your data types are simple, things should for the most part "just work."

Can you give an example of a function prototype for one of the functions you want to call from .NET?

I would like to pass some image structure eventually, Im hoping to add more functions.
TBH my project goal is to make an interface similar/better to what we use in Matlab using simple Opencv functions and then maybe add to the functionality. I am interested to learn how to create dlls and wrappers for some of these functions as I want to take my programming to a more sophisticated level but I'm looking into the Emugu wrapper atm.