C# dll can be used in C++/CLI project easily?
I have one C++/CLI project, a GUI applic开发者_JAVA技巧ation, which is compiled in mixed mode (managed+unmanaged). Now I want to write a custom user control using C# and compile it to become CSharpA.dll. my question is: Can this dll be used by my C++/CLI project easily? How would I do that?
Yes. Just add a reference to it. You may find yourself wanting using namespace
directives, which, like the C# using
directive, will add classes in other namespaces into the search space.
You only have to compile your C# code into an assembly, and this assembly can be referenced from your C++/CLI App as any other assembly.
精彩评论