windows-8 – 为什么在自定义WinRT C/C++X控件中默认添加了[Windows :: Foundation :: Metadata :: WebHostHidden]?

当我在WinRT C/C++X项目中创建新控件时,Visual Studio 2012添加属性[ Windows :: Foundation :: Metadata :: WebHostHidden].

例:

namespace WindowsRuntimeComponent1
{
    [Windows::Foundation::Metadata::WebHostHidden]
    public ref class MyUserControl sealed
    {
    public:
        MyUserControl();
    };
}

>这有什么记录的原因吗? (我做了我的作业,但我
未能找到这条信息)
>据我所知,使用属性[WebHostHidden]使该类成为可能
对WinRT HTML / Javascript项目不可见.这是否意味着我
无法在C/C++X中创建可以在Javascript中使用的控件?

As far as I kNow,using the attribute [WebHostHidden] makes the class invisible for WinRT HTML/JavaScript projects.

这是正确的:此属性隐藏了JavaScript投影中的类型,因此从JavaScript开始,就好像该类型不存在一样.

Does this mean that I cannot create a control in C++/CX that can be used in JavaScript?

您不能使用JavaScript中的XAML控件.使用JavaScript时,UI是使用HTML而不是XAML创作的.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...