0

Possible Duplicate:
What are my options for C++ DLL to call a C# DLL?

Okay so there is a load of material talking about how to wrap unmanaged code written in C++ or other languages and compiled to a DLL, and making a C# wrapping to make this unmanaged code something that can be called from C# directly.

I can't seem to find any material on calling managed code, from unmanaged code. That is, given a C# library, I'd like to wrap it such that I can call it's functions from C++. It that possible?

Community
  • 1
  • 1
acp10bda
  • 311
  • 1
  • 4
  • 14
  • here's just one of the mahny hits from google: http://support.microsoft.com/kb/828736. Basically you use COM. – stijn May 10 '11 at 09:16
  • Definite duplicate of the dozens of related questions that pop up when you type in this question's title in the Ask Question form. =) – J. Steen May 10 '11 at 09:27
  • 1
    J. Steen, nearly all of those are talking about the reverse procedure. stijn, a COM was not a good solution for me, and I suppose that would have been a good question for me to have found earlier, but all I saw was a sea of people asking the reverse question a million times. – acp10bda May 10 '11 at 09:56
  • Ah, my bad. It *is* usually the reverse, yes. =) – J. Steen May 10 '11 at 10:53

2 Answers2

0

This might be worth looking at.

Sani Huttunen
  • 23,620
  • 6
  • 72
  • 79
  • Definitely worth looking at. This is like exactly what I was looking for, but now that I realize how much work I'm setting up for myself with the possibility of it not working, I think I'll do something else, but this is good for future reference. Thank you. – acp10bda May 10 '11 at 09:42
0

You might want to expose your component to COM interop: http://msdn.microsoft.com/en-us/library/c3fd4a20.aspx

Martijn
  • 11,964
  • 12
  • 50
  • 96