Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Windows Phone运行时组件中使用本机类 我试图使用静态库重用一些C++代码。 例如,如果这是我在静态库中的C++类。 class testclass { testclass(); ~testclass(); void printsomethig(); void dosomething(); };_C++_Windows Runtime_Windows Phone 8_Native - Fatal编程技术网

如何在Windows Phone运行时组件中使用本机类 我试图使用静态库重用一些C++代码。 例如,如果这是我在静态库中的C++类。 class testclass { testclass(); ~testclass(); void printsomethig(); void dosomething(); };

如何在Windows Phone运行时组件中使用本机类 我试图使用静态库重用一些C++代码。 例如,如果这是我在静态库中的C++类。 class testclass { testclass(); ~testclass(); void printsomethig(); void dosomething(); };,c++,windows-runtime,windows-phone-8,native,C++,Windows Runtime,Windows Phone 8,Native,现在我想在我的运行时项目中继承这个类,稍后我想从我的WindowsPhone8C#项目调用它,但问题是本机类不能是公共的,如果不是公共的,我就看不到方法和函数。例如: public class runtimeTestClass : testclass { runtimeTestClass(); ~runtimeTestClass(); }; 问题是在运行时本机不能是公共的(错误消息),必须是 public ref runtimeTestClass sealed { runt

现在我想在我的运行时项目中继承这个类,稍后我想从我的WindowsPhone8C#项目调用它,但问题是本机类不能是公共的,如果不是公共的,我就看不到方法和函数。例如:

public class runtimeTestClass : testclass
{
   runtimeTestClass();
   ~runtimeTestClass();
};
问题是在运行时本机不能是公共的(错误消息),必须是

public ref runtimeTestClass sealed
{
    runtimeTestClass();
   ~runtimeTestClass();
};
但这样我就不能继承任何东西

有人知道我怎么解决这个问题吗


提前感谢您

如果我是您,我会选择在现有类周围创建WinRT包装,而不是使用继承

如果您将
runtimeTestClass
WinRT类的所有功能委托给
testclass
的私有实例,那么您将能够从c#使用它。

可能重复的