Answered by:
declare a vector of arrays or an array of arrays (Platform::Collections::Vector<Platform::Array<uint16>^>^)

Question
-
I need to declare a vector of arrays or an array of arrays in c++ but if I declare it in the following way:
Platform::Collections::Vector<Platform::Array<unsigned char>^>^ mVectorArray = ref new Platform::Collections::Vector<Platform::Array<unsigned char>^>();
But I get the following compiler error, and I don't know how to fix it:
1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\collection.h(508): error C2728: 'Platform::Array<__TArg,__dimension> ' : a native array cannot contain this type 1> with 1> [ 1> __TArg=unsigned char, 1> __dimension=1 1> ] 1> Did you mean 'array<Platform::Array<__TArg,__dimension> >'? 1> with 1> [ 1> __TArg=unsigned char, 1> __dimension=1 1> ] 1> Multicast.cpp(100) : see reference to class template instantiation 'Platform::Collections::Vector<T>' being compiled 1> with 1> [ 1> T=Platform::Array<unsigned char,1> ^ 1> ] 1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vccorlib.h(790): error C3964: jagged array is not supported 1> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vccorlib.h(794) : see reference to class template instantiation 'Platform::WriteOnlyArray<__TArg,__dimension>' being compiled 1> with 1> [ 1> __TArg=Platform::Array<unsigned char,1> ^, 1> __dimension=1 1> ] 1> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\collection.h(520) : see reference to class template instantiation 'Platform::Array<__TArg,__dimension>' being compiled 1> with 1> [ 1> __TArg=Platform::Array<unsigned char,1> ^, 1> __dimension=1 1> ] 1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vccorlib.h(796): error C3964: jagged array is not supported 1> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vccorlib.h(796) : see reference to class generic instantiation 'Platform::IBoxArray<T>' being compiled 1> with 1> [ 1> T=Platform::Array<unsigned char,1> ^ 1> ]
Thank you!
Monday, October 1, 2012 10:27 AM
Answers
-
Hello,
I think this issue
is caused by we can not use jagged array with Windows Runtime type in C++/CX.Best regards,
Jesse
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us
- Marked as answer by Jesse Jiang Monday, October 8, 2012 3:11 AM
Tuesday, October 2, 2012 4:21 AM
All replies
-
Hello,
I think this issue
is caused by we can not use jagged array with Windows Runtime type in C++/CX.Best regards,
Jesse
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us
- Marked as answer by Jesse Jiang Monday, October 8, 2012 3:11 AM
Tuesday, October 2, 2012 4:21 AM -
Is there any other way to do that?
I've also tried with std::vector but other errors appeared.
Thank you
Tuesday, October 2, 2012 8:23 AM -
Hi,
Maybe you can try to use native point, and use a function to get the value.
Best regards,
JesseJesse Jiang [MSFT]
MSDN Community Support | Feedback to us
Monday, October 8, 2012 3:12 AM