集成和分离托管(解释)(.NET)和非托管(编译)(ANSI/ISO/GCC 等)C++
我对 VC++ 项目已经很深入了,但我推迟发布它,因为我的所有非托管代码都将与 .NET 代码混在一起,因为这是 Visual C++ 2008 Express 中的一个大型 Windows 窗体项目。如果发生这种情况,我的代码将很容易受到逆向工程的影响。
有人知道如何确保我的可移植、非托管、本机、C++ 类、文件等被 x86 汇编程序编译吗?
在本机类中使用 gcroot 有何影响?
http://msdn.microsoft.com/en-us/library/ms973872.aspx 是一个开始。 “一次编写,随处运行”的可移植性神话就到此为止。看来我需要了解 COM 才能重用 C++ 类。虽然“扁平 API”存在更简单的解决方案,但我认为它们意味着无对象代码。
I am getting quite far into a VC++ project but am put off releasing it by the thought that all my unmanaged code will be lumped with the .NET code since this is one big Windows Forms project from Visual C++ 2008 Express. If this happens my code will be too prone to reverse engineering.
Anyone got any pointers for how to ensure my portable, unmanaged, native, C++ classes, files etc get compiled down x86 assembler?
How does using gcroot in native classes affect this?
http://msdn.microsoft.com/en-us/library/ms973872.aspx is a start. So much for the myth of "write-once-run-anywhere" portability. Seems I need to learn about COM to reuse C++ classes. While simpler solutions exist for 'flat APIs' by that I assume they mean object-less code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://msdn.microsoft.com/en -us/library/0adb9zxe%28v=VS.90%29.aspx
提供了答案。 VS2008 默认不为非托管类生成本机代码。因此,我将在每个函数之前放置#pragma unmanaged's。
http://msdn.microsoft.com/en-us/library/0adb9zxe%28v=VS.90%29.aspx
provides the answer. VS2008 does NOT default to producing native code for unmanaged classes. So I will placing #pragma unmanaged's before each function there.