积极答复者
WinRT组件 传递Windows::Foundation::Collections::IVector<T>

问题
-
大家好,
关于在WinRT组件的公有成员中包含Windows::Foundation::Collections::IVector<T> 的传递,大家有什么思路吗?
我现在的代码片段如下:
namespace MyDevice {
public value struct ADDEVICE_CHIP_INFO
{
Platform::String^ ChipDesc; // Contains description of chip.
Windows::Foundation::Collections::IVector<Platform::String^> ^VoltageList; // Contains information about supporting input voltage list.
};public ref class ADDevice sealed
{
private:
String^ m_Id;
ADDEVICE_CHIP_INFO m_ChipInfo;
ComPtr<IDeviceIoControl> m_DeviceIoControl;
ADDevice(__in IDeviceIoControl* DeviceControl, __in String^ Id);
~ ADDevice ();public:
static String^ GetDeviceSelector();
static ADDevice^ FromId(__in String^ InterfacePath);property ADDEVICE_CHIP_INFO ChipInfo
{
ADDEVICE_CHIP_INFO get(); //return the struct which contain the information of the device}
}
//other classed
}
当编译的时候提示错误
error C3992:"VoltageList":Singnature of public member contains invalid type:Windows::Foundation::Collections::IVector<T> ^
希望大家能给我一点提示
答案
-
Hi,
这篇文章中Passing IVector章节能够帮助你吗?
http://msdn.microsoft.com/en-us/library/windows/apps/hh441569.aspx
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- 已标记为答案 wuxianghou 2013年1月31日 7:34
全部回复
-
Hi,
这篇文章中Passing IVector章节能够帮助你吗?
http://msdn.microsoft.com/en-us/library/windows/apps/hh441569.aspx
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- 已标记为答案 wuxianghou 2013年1月31日 7:34
-
hi Aaron
我看了这篇文章,然后也按照这个文章中的方法传递了IVector。
但是为什么
public value struct ADDEVICE_CHIP_INFO
{
Platform::String^ ChipDesc; // Contains description of chip.
Windows::Foundation::Collections::IVector<Platform::String^> ^VoltageList; // Contains information about supporting input voltage list.
};这样的结构会出错呢?希望你能给我一些帮助
-
Hi,
有可能是WinRT组件中公有成员只能够使WinRT的类型,那篇文章应该介绍到这一点。
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.