title: How to use a C++ dll in Windows Phone 8.1 XAML App within C++ Runtime Component
body: <p>I want to use a C++ dll (compiled for arm, x86) within my C# windows phone 8.1 XAML visual studio project.</p>
  
  <p>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:</p>
  
  <pre><code>The specified module could not be found. (Exception from HRESULT: 0x8007007E)
  </code></pre>
  
  <p>My Visual Studio Project Structure:</p>
  
  <ul>
  <li>c#
  
  <ul>
  <li>Windows Phone Project</li>
  <li>Windows Project</li>
  <li>Shared XAML</li>
  </ul></li>
  <li>Managed C++
  
  <ul>
  <li>RuntimeComponent Windows Phone</li>
  <li>RuntimeComponent Windows</li>
  <li>Shared C++ Code (dll used here)</li>
  </ul></li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/5Vqfc.png" alt="enter image description here"></p>
  
  <p>Things I have tried: </p>
  
  <ul>
  <li>I dragged and dropped the dll into my C++ project and changed properties  of content to true.</li>
  <li>I dragged and dropped the dll into my C# project and enabled the option to copy the dll to the output directory</li>
  </ul>
  
  <p>So, how can I use a .lib/.dll library within a C++ Runtime Component Project?</p>
  
  <p><strong>Some more details:</strong></p>
  
  <ul>
  <li>I want to use Angle (which allows OpenGL Code to be executed as DirectX on Windows/Windows Phone with the Microsoft fork: <a href="https://github.com/MSOpenTech/angle/tree/future-dev" rel="nofollow noreferrer">https://github.com/MSOpenTech/angle/tree/future-dev</a>)</li>
  <li>There are templates provided for Windows Phone 8.1 for pure C++ based on libEGL.lib/dll and libGLES.lib/dll (manually compiled for arm, win32)</li>
  <li>But I want to use a C# project with C++ Runntime Component to be able to use third party libs like the admob ad framework for Windows Phone</li>
  <li>I found out that cocos2d is using Angle but I have not figured out how they did it (<a href="https://github.com/cocos2d/cocos2d-x/tree/v3/templates/cpp-template-default/proj.wp8-xaml" rel="nofollow noreferrer">https://github.com/cocos2d/cocos2d-x/tree/v3/templates/cpp-template-default/proj.wp8-xaml</a>)</li>
  </ul>