locked
why array can not find?

    Question

  • when I update vs2011 preview to vs2011 beta, I found arrry can not be  found in c++ winrt dll. There is a error: array is not a template. In vs2011 preview I use array to pass byte[] from c# to c++ like this:

    void TestSocket::Send(array<unsigned char>^ buff);

    Tuesday, March 13, 2012 5:47 AM

All replies

  • Hello,

    Did you forget to include <array>
    and using namespace std;

    The array<> constructor has two parameters type and number of elements, like this
     array<int, 4> ai = { 1, 2, 3 };

    http://msdn.microsoft.com/en-us/library/bb983093(v=vs.110).aspx

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, March 14, 2012 3:04 AM
  • Hello,

    I marked my reply as answer, if your issue have not been solved please unmark it and update more information about this issue.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Monday, March 19, 2012 8:14 AM
  • Hi,Jesse

    I include <array> and using namespace std, but it still do not work.I found consumer version has turn array into Platform::Array and it works. But I found another question with Platform::Array, its dimension only support 1. Can you tell me why?

    Monday, March 19, 2012 9:21 AM