简体   繁体   中英

How to use a C++ dll in Windows Phone 8.1 XAML App within C++ Runtime Component

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

I created a C++ runtime component to interact with my C++ code. This code needs a precompiled dll. I added my lib file to my project settings. The compilation is running fine. If I start my app with the windows phone 8.1 emulator I get:

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

My Visual Studio Project Structure:

  • c#
    • Windows Phone Project
    • Windows Project
    • Shared XAML
  • Managed C++
    • RuntimeComponent Windows Phone
    • RuntimeComponent Windows
    • Shared C++ Code (dll used here)

在此输入图像描述

Things I have tried:

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

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

Some more details:

I managed to get it working.

You have to import the dll into the C#-project. It's important that the dll is in the root the C#-project and that: copy to output directory is not activated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM