Manged VC ++ to unmanged VC ++示例 [英] Manged VC++ to unmanged VC++ example
本文介绍了Manged VC ++ to unmanged VC ++示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想在非托管代码(VC ++)中编写一个应该通过托管VC ++代码调用的函数。
我需要做什么才能完成这项任务?我需要在文件中包含哪些名称空间?
一段代码非常有用。
谢谢。
问候,
Joy
解决方案
请参阅托管,非托管 [ ^ ] MSDN部分。
你不需要做一些特殊的事情。假设您有一对带有本机代码的.h / .cpp,您可以在其中实现这些函数/类,确保将它们添加到项目中(主要是源代码),在C ++ / CLI源文件中包含标题,然后调用方法。调用方法没有什么特别于你从C ++中知道的。
Hi all,
I wanted to write a function in unmanaged code (VC++) that should be called through managed VC++ code.
What all i need to do this task? What all namespaces I need to include in the files?
Piece of code would be really helpful.
Thanks.
Regards,
Joy
解决方案
See managed, unmanaged[^] section of MSDN.
You don''t need to do something special. Suppose you have a pair of .h/.cpp with native code where you implement these functions/classes, make sure they are added to the project (the source mainly), include the header in your C++/CLI source file and just call the method. There is nothing special in calling methods than what you know from C++.
这篇关于Manged VC ++ to unmanged VC ++示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文