Search code examples
windows-phone-8c++-cxvisual-c++-2012

byte array parameter in visual c++


i am new to visual c++.. I had a method in .h file something like this:

  public:
   void DoSomething();

Here i need to pass byte array as parameter and i need to implement it in .cpp file.. I am working on windows phone 8 for this i need to include visual c++ project of windows phone run time component. I need to use this method in c# class and pass the byte array from there. But i dont know how to declare a byte array method in c++. can any one please help me to find the solution.


Solution

  • In C++/CX, what you're using for a Runtime Component, the signature would look like this (assuming you have a ref class):

    void DoSomething(const Platform::Array<uint8>^ something);

    This could be called from C# directly by passing in a byte[].