0

I have created the run time component in c++ for the windows phone 8.1. The run time component method returns the byte array which is in the same method. I want to get this byte array from windows phone 8.1 application c# code.

For that , I have tried the below code.

Runtime Component class.

Class1.h

using Platform;

Class Class1
{
   public:

      class1();

      void decodeBuffer(IntPtr decodedBuffer, int * length);
}

Class1.cpp

Class1::class1()
{

}

void Class1::decodeBuffer(IntPtr decodedBuffer, int * length)
{
    byte[] buffer = {1,2,3,4};

    decodedBuffer = buffer;

    length = 4;
}

I want to use this class from my windows phone application.

Windows phone 8.1 project MainPage.xaml.cs

protected virtual void OnNavigatedTo(NavigationEventArgs e)
{
   IntPtr ptr = IntPtr.Zero;

   int length = 0;

   Class1 obj = new Class1();

   obj.decodeBuffer(ptr,out length);
}

It gives me an error.

I have also tried to pass it as below.

void decodeBuffer(unsigned char **decodedBuffer, int * length);

But it also give me an :Error “signature of public member contains native type" in Runtime Component.

Does anybody have an idea about it?

0 Answers0