Windows Phone 7和本地C ++ / CLI [英] Windows Phone 7 and native C++/CLI

查看:296
本文介绍了Windows Phone 7和本地C ++ / CLI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

微软最近发布的工具和文档其新Phone 7平台,而那些谁有一个大的C ++ codeBase的(比如我)的不舍不支持原生开发了。虽然我已经找到了被逆转这个决定的猜测,我对此表示怀疑。所以我在想如何可行的是通过调整它℃下在++ / CLI编译使这个codeBase的可供Phone 7的。当然,用户界面​​部分不能被移植,但我不知道休息。任何人有过类似的经历吗?我不是在谈论code,做重低层次的东西 - 但有一个很频繁使用的模板和智能指针

Microsoft recently released tools and documentation for its new Phone 7 platform, which to the dismay of those who have a big C++ codebase (like me) doesn't support native development anymore. Although I've found speculation about this decision being reversed, I doubt it. So I was thinking how viable would be to make this codebase available to Phone 7 by adapting it to compile under C++/CLI. Of course the user interface parts couldn't be ported, but I'm not sure about the rest. Anyone had a similar experience? I'm not talking about code that does heavy low-level stuff - but there's a quite frequent use of templates and smart pointers.

推荐答案

C ++ / CLI理论上可以用WPF / Silverlight中使用与可以在主内使用宏定义替换从XAML生成的C#的伎俩使用类隐藏文件一个code。我摸索出这种技术,但还没有动机把它超越理论 - 我很高兴混合语言

c++/cli can theoretically be used with WPF/Silverlight using the trick of replacing the C# generated from the XAML with a macro definition that can be used inside the main class in a code behind file. I worked out this technique but haven't had the motivation to take it beyond theory - I'm quite happy mixing languages.

至于在你的逻辑code纯安全模式下使用C ++ / CLI,这可能仍然是不可能的,但我很想听听怎么有人去尝试,现在它。虽然研究它Silverlight的早在2008年,我发现这个艰巨的 Silverlight的论坛评论

As far as using c++/cli in a pure safe mode for your logic code, this may still not be possible but I'd love to hear how someone goes trying it now. Whilst researching it for Silverlight back in 2008 I found this daunting silverlight forum comment:

我刚给的Silverlight和C ++它从我的C ++项目编译成MSIL一个Silverlight兼容的DLL一试。好消息:它的工作原理,你可以从一个Silverlight项目称之为code。坏消息是:C ++编译器显然使用了Silverlight的禁止MSIL指令

所以,如果你试试这个,即使是最简单的方案,你几乎立刻得到异常的操作可能动摇的运行时间。:要我来说,这使得它看起来不太可能,我们很快就会看到的Silverlight对于C ++,因为编译器将需要以不同的表现颇有几分。

So, if you try this, even with the simplest of programs, you'll almost immediately get the exception "Operation could destabilize the runtime." To me, this makes it seem less likely that we'll see Silverlight for C++ soon, as the compiler will need to behave quite a bit differently.

这篇关于Windows Phone 7和本地C ++ / CLI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆