I am trying to add a C++ DLL to Windows Phone 8
framework in Visual Studio Express 2012.
I have tried following ways
Import and invoke through PInvoke
[DllImport("WP8DLL.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int functionReturningInteger();
Result: This way though there were no compile errors, but when I try to access the method of the DLL it throws System.NotSupportedException
.
Adding reference in the project properties
Result: I get the message "A reference to a higher version or incompatible assembly cannot be added to the project"
You cannot add a reference from a Managed Windows Phone 8 Project directly to a native static or native dynamic library. You will need to create a Windows Phone Runtime Component. Those can be referenced by you UI project and also it can reference C++ projects, etc.
See for example this link for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With