开发者

C# dll can be used in C++/CLI project easily?

开发者 https://www.devze.com 2023-01-22 03:30 出处:网络
I have one C++/CLI project, a GUI applic开发者_JAVA技巧ation, which is compiled in mixed mode (managed+unmanaged).

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消