title: Writing a C++ DLL that a C# .NET Application can call?
body: <p>This is the situation. I am writing a backend application in C++ and my colleagues are using C# for the frontend. Basically, my backend application does image processing on images received from the C# frontend and returns a text file with data about the image.
  What we were doing earlier was writing the images to disk and calling the C++ application with the file path of the image as a parameter. However, this writing/reading from disk has become a bottleneck, so we are wanting to convert the C++ application to a DLL.</p>
  
  <p>At the basic level, what I want is to expose a single method from my C++ application to the C# one through a DLL (the C# application is web-based):</p>
  
  <pre><code>int ProcessImage(System::Bitmap^ image, System::String ^results)
  </code></pre>
  
  <p>How can I go about doing this? I am using VC++ Express 2008 and my C++ code currently compiles with CLR (although I have mixed a lot of native C++ code inside).</p>
  
  <p>I have been looking around on the web, but am still stuck on how to do this. I think a C++/CLI DLL is the best option, but how do I do this?
  <a href="https://stackoverflow.com/questions/3726829/writing-a-dll-in-c-c-for-net-interoperability">Writing a DLL in C/C++ for .Net interoperability</a></p>