I am trying to import coredll and use one of its apis in a C # Windows Phone project This is a piece of code
[DllImport("coredll.dll", SetLastError = true)] static extern Int32 GetLastError(); private void Button_Click_1(object sender, RoutedEventArgs e) { try { GetLastError(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
I get the following exception on a Windows Phone 8 System.NotSupportedException: DllImport cannot be used by PS custom methods : this is true for any API, not just this API. Coredll is a C ++ library, and I use it in a C # project. What's going on here? Thanks, Viral
source share