简体   繁体   English

C ++ Windows Phone 8组件

[英]C++ windows phone 8 components

I'm new to windows phone development, and I need to create a control with C++ (basically it's a WebBrowser control) I would create with C# but the library I need to use for core is written in C++. 我是Windows Phone开发的新手,我需要使用C ++创建一个控件(基本上是WebBrowser控件),而我将使用C#创建一个控件,但是我需要用于核心的库是用C ++编写的。

Conclusion: So the question is, Can I develop a control in C++ using external libraries and then compile it to use with any language of the CLR and use it in my windows phone 8 applications? 结论: 所以问题是,我可以使用外部库在C ++中开发控件,然后将其编译为与任何CLR语言一起使用并在Windows Phone 8应用程序中使用它吗? If does, let me know about some resource any video, book, or whatever. 如果有的话,请让我知道一些视频,书籍或其他资源。

The general answer is "yes", although it comes with some caveats. 普遍的回答是“是”,尽管有一些警告。

It's certainly possible to build a component in C++ using the Windows Phone Runtime APIs and then utilize it from another programming language, such as C#. 当然,可以使用Windows Phone运行时API在C ++中构建组件,然后通过另一种编程语言(例如C#)来利用它。 The more "pure" the C++ code is in that it doesn't access native operating system features (that may not be present), the better off you'll be. 由于C ++代码无法访问本机操作系统功能(可能不存在)而越“纯净”,您的情况就会越好。

There's some general guidance on MSDN: 关于MSDN,有一些一般指导:

  1. Native code for Windows Phone 8 Windows Phone 8的本机代码
  2. Windows Phone Runtime API Windows Phone运行时API
  3. Using Native C++ code in your Apps 在您的应用程序中使用本机C ++代码

That being said, if you're attempting to create an entirely new web browser for some reason, I'd strongly suggest you consider using the built in WebBrowser component. 话虽如此,如果您出于某种原因试图创建一个全新的Web浏览器,强烈建议您考虑使用内置的WebBrowser组件。 In Windows Phone 8, it's based on IE10, and in Windows Phone 8.1, it's IE 11. Those are both very capable browsers and designed to work well within the memory constraints of the platform. 在Windows Phone 8中,它基于IE10;在Windows Phone 8.1中,它是IE11。这两种浏览器都非常强大,并且设计为在平台的内存限制内正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM