How to get back an IntPtr in c++ for WP8 plugin?

Hi there.

I’m new on the forum and also in dev for winphone platform.
I’m right now stuck because I don’t know how to pass an IntPtr type from my c# code to my c++ code. It’s actually much easier for android or iOS plugin since we can get back the data as a void*.
However in a Windows Phone Runtime Component project it’s not possible. So I use WinRT type.

Here are my code samples:

In C#:

public delegate void WP8EnableTextureDrawing(System.IntPtr texture);
private WP8EnableTextureDrawing wp8EnableTextureDrawing;
public void SetWP8TextureDrawingFunc(WP8EnableTextureDrawing func)
{
    wp8EnableTextureDrawing = func;
}


//...

wp8EnableTextureDrawing(targetTexture.GetNativeTexturePtr());

In the c++ header file I matches the delegate this way:

static void enableTextureDrawing(Platform::Object ^texturePtr);

But the compiler throws this error →
No overload for ‘WP8TextureDrawing.TextureDrawing.enableTextureDrawing(object)’ matches delegate ‘NativeTextureDrawer.WP8EnableTextureDrawing’

I hope someone who has already get his hands in this would help me out.

Thanks

Well you could cast it to int, and pass it as integer.