同一项目下的CPP和CS文件 [英] CPP and CS files under same project
问题描述
大家好,
最近我遇到了一种情况,我必须从C ++调用C#代码。
在对它进行一些研究之后,我可以通过将C#代码作为DLL然后使用 C ++ / CLI 静态库来实现它,该库引用了C#DLL然后使用它我的本机C ++代码中的C ++ / CLI lib。
但我真的很怀疑,我真的需要制作DLL和LIB来实现这一目标吗?
还有更好的办法吗?
所以我的问题是:
1.是否有可能,如果我可以直接在单个项目下围绕C#类使用C ++ / CLI包装器?没有创建C#DLL?
提前谢谢
Hi All,
Recently i came across a situation, where in I have to call C# code from C++.
After doing some research over it, I could achieve it by making C# code as DLL and then having a C++/CLI static lib, which has reference to C# DLL and then using this C++/CLI lib in my native C++ code.
But i am really doubtful, Do i really need to make a DLL and LIB to achieve this?
Is there any better way to do that?
So my question is:
1. Is it possible, if i can have C++/CLI wrapper around C# class directly under a single project? without creating a C# DLL?
Thanks in advance
推荐答案
看到这些建议:https://www.google.com/search?q=call+C% 23 +代码+来自+ C%2B%2B [ ^ ]。
See these suggestions: https://www.google.com/search?q=call+C%23+code+from+C%2B%2B[^].
这篇关于同一项目下的CPP和CS文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!