How to use C ++ dll in Windows Phone 8.1 XAML Application in C ++ Runtime Component

I want to use a C ++ dll (compiled for arm, x86) in my Windows phone C # 8.1 XAML visual studio project.

I created a C ++ runtime component to interact with my C ++ code. This code needs a pre-compiled dll. I added my lib file to my project settings. Compilation works fine. If I run my application with Windows Phone 8.1 emulator, I get:

The specified module could not be found. (Exception from HRESULT: 0x8007007E)

      

My Visual Studio structure:

  • FROM#
    • Windows Phone Project
    • Windows project
    • Generic XAML
  • Managed C ++
    • RuntimeComponent Windows Phone
    • RuntimeComponent Windows
    • Generic C ++ Code (dll used here)

enter image description here

Things I've tried:

  • I dragged the dll into my C ++ project and changed the content properties to true.
  • I dragged the dll into my c # project and enabled the ability to copy the dll to the output directory

So how can I use the .lib / .dll library in a C ++ Runtime Component Project?

Additional Information:

+3


source to share


1 answer


I managed to get it to work.



You need to import the dll to C # -project. It is important that the DLL is in the root of the C # project and that: notcopy to output directory

activated .

+1


source







All Articles