locked
3rd party dll RRS feed

  • Question

  • Hi there,

    I am trying to develope a Win8 modern ui app. I have a 3rd party dll I added to my project. Good thing, VS2012 seems to find and accept the dll but when I start the Windows 8 App, it just doesnt work without any error message. If I create a windows Forms Project with the same code, everything works flawless. Im trying to connect to this USB i/o board: http://www.velleman.eu/products/view/?id=351346&country=de&lang=en

    In that case I use the K8055D.dll within my project in C#. [DLLImport("K8055D.dll")] works fine on a windows forms Project but it has no effect on a Windows 8 (Modern ui) project.

    Is there any chance to make this work for a windows 8 app?

    Please refer to: https://play.google.com/store/apps/details?id=com.digiwack.k8055Limited&hl=en as it works on other platforms aswell.

    Thank you

    Friday, October 4, 2013 7:57 AM

Answers

  • You can use DLLs which use only valid API for Windows Store apps. Others wont pass certification and may have incorrect behavior at runtime since API calls they depend on may fail when run in the Windows Store app's secured environment. See Win32 and COM APIs for a discussion on allowed API. You will need a version of the DLl designed and built to run in this environment.

    That said, it probably won't exist on Windows 8. Windows 8.1 adds the necessary USB classes for Windows Store apps. See USB device support

    As Vishal suggests, there are similar issues with invalid .Net assemblies, but those will be caught sooner since there is more versioning information available.

    --Rob

    • Marked as answer by AtariRiot Monday, October 7, 2013 8:20 PM
    Friday, October 4, 2013 2:46 PM
    Moderator

All replies

  • Windows Store Apps uses a subset of Full .NET Framework 4.5, you are not allowed to use anything outside of that subset. There are only two types of Assemblies (*.dll) you can use with Windows Store Apps

    (1) Windows Store Apps Class Library

    (2) Portable Class Library (which has Windows Store Apps as a target platform)

    Fact that your DLL works with windows forms and not with Windows Store Apps tells me it is a regular .NET Class Library and hence it will not work.

    I would expect Visual Studio 2012 to warn you at first place, but anyway.

    Refer .NET for Windows Store apps overview 


    -- Vishal Kaushik --

    Please 'Mark as Answer' if my post answers your question and 'Vote as Helpful' if it helps you. Happy Coding!!!

    Friday, October 4, 2013 10:59 AM
  • You can use DLLs which use only valid API for Windows Store apps. Others wont pass certification and may have incorrect behavior at runtime since API calls they depend on may fail when run in the Windows Store app's secured environment. See Win32 and COM APIs for a discussion on allowed API. You will need a version of the DLl designed and built to run in this environment.

    That said, it probably won't exist on Windows 8. Windows 8.1 adds the necessary USB classes for Windows Store apps. See USB device support

    As Vishal suggests, there are similar issues with invalid .Net assemblies, but those will be caught sooner since there is more versioning information available.

    --Rob

    • Marked as answer by AtariRiot Monday, October 7, 2013 8:20 PM
    Friday, October 4, 2013 2:46 PM
    Moderator
  • I understand,

    I guess with WP8 Apps its the same, so, please tell me how is it possible there are Apps out that connect to chinese DVRs (Digital Video Recorders) without using the corresponding dlls then? Since i have several SDKs for these here and they all use special Active X OCX and DLL files, how can Clients for Windows Phone be possible then?

    For example:

    http://www.windowsphone.com/en-us/store/app/meye/c18c8c75-6f35-4be7-9eb0-4c7bd8773236

    Friday, October 4, 2013 10:12 PM
  • Windows Phone 8 is a different operating system from Windows 8 and includes USB and Bluetooth API.

    WP8 apps cannot use x86 DLLs. Any SDKs used need to target WP8 specifically. The WP8 client could also bypass the SDK and call the server directly via USB or networking API.

    --Rob

    Friday, October 4, 2013 10:44 PM
    Moderator