title: Referencing C Dlls from Windows 10 Universal App Across CPU Architectures
body: <p>Basic question/summary: I need to reference a binary (dll) created by someone else in C from a Win 10 universal app project. However, there is a separate dll for x86 and arm. I believe I need to reference the dll (or at least winmd file) from the project for it to be deployed, but I can only reference one file not both. That means the app fails on one platform or another (desktop or phone) because it has the wrong binary included. Looking for a solution.</p>
  
  <p>More detailed explanation;</p>
  
  <p>I am trying to write a Universal Windows application (new Windows 10 style). This means I have a single project to add references to external components to. </p>
  
  <p>I have the need for some image processing stuff that is best bought as a 3rd party component rather than developed in house. There are several SDK's available from 3rd parties that support WinRT but none that specifically support UWA. The WinRT SDK's however all have different binaries for Windows Phone and Windows Desktop apps. and the binaries are all created from C/C++ source. This was fine with the older 'universal' apps because there was a separate project for phone and desktop so you could just reference different components in each project, but now there's only one project to add references to.</p>
  
  <p>I asked one supplier about UWA support and they claimed it was impossible, they couldn't create a single binary to target both platforms (arm vs x86) and they didn't know a way for my UWA to reference the right file when the app is built for the appropriate architecture (which is what I assume should happen).</p>
  
  <p>I <em>assume</em> there is someway (perhaps in a winmd file?) to say, 'hey, here's two copies of the same dll for different CPU architectures, pick the one you're building for' and so long as the public API matches the app just uses the right one?</p>
  
  <p>Is there a solution for this? Does anyone know how this sort of reference is supposed to work? Or am I just out of luck?</p>
  
  <p>Thanks.</p>