locked
Is SDK or DLL developed Using C supported in Windows Store Apps? RRS feed

  • Question

  • Hi,

    Here is the Windows 8 Architecture.

    It is Mentioned that C is Supported in the Architecture.

    But I came to know that if the client is in C#, it cannot add reference to C dll in the project, since it is a plain C Dll, not a C++/CLI dll. 

    I am doing Proof of Concept which uses C dll's in Windows 8 apps can anybody direct the right path for me?

    Thanks in Advance.


    srithar

    Friday, January 11, 2013 3:06 PM

Answers

  • Yup you can still do the old Export methods and p/Invoke straight into native code. But the prettier (and from what I've heard more performant) way is to create a WinRT C++/CX wrapper around your native libraries.

    Only think you have to make sure is that your C dll isn't calling any of the "illegal" or removed Windows calls. You can use the Windows App Certification Kit to test that. Just plop the C dll into your appx as content, build, deploy and then run WACK against the app. It'll tell you if your C dll contains anything it's not supposed to use.


    /Morten
    twitter: http://www.twitter.com/dotMorten
    blog: http://www.sharpgis.net


    Friday, January 11, 2013 8:08 PM
  • You are right that you can use either C/C++ or C#/VB or javascript to create Windows Store apps. I will check your C and C# scenario and report back.

    Update: This stackoverflow thread offers good info on how to use old dlls (native and managed) in Windows Store Apps and how to check supported APIs in the .NET for Windows Store apps. If the DLLs are managed code, the list of support APIs can be found at MSDN.

    Friday, January 11, 2013 8:11 PM
  • Hi,

    Yes. You can use C dll or C methods in Windows Store apps. But not all the CRT functions are supported in WinRT.

    You could check this list:

    Windows Runtime Unsupported CRT Functions

    If you want to use the dll in C#, you have to use p/invoke.

    Here are some reference:

    http://www.pinvoke.net/


    Aaron
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Aaron Xue Monday, January 14, 2013 9:15 AM
    • Marked as answer by Srithar Tuesday, January 15, 2013 5:19 AM
    Monday, January 14, 2013 9:14 AM

All replies

  • Yup you can still do the old Export methods and p/Invoke straight into native code. But the prettier (and from what I've heard more performant) way is to create a WinRT C++/CX wrapper around your native libraries.

    Only think you have to make sure is that your C dll isn't calling any of the "illegal" or removed Windows calls. You can use the Windows App Certification Kit to test that. Just plop the C dll into your appx as content, build, deploy and then run WACK against the app. It'll tell you if your C dll contains anything it's not supposed to use.


    /Morten
    twitter: http://www.twitter.com/dotMorten
    blog: http://www.sharpgis.net


    Friday, January 11, 2013 8:08 PM
  • You are right that you can use either C/C++ or C#/VB or javascript to create Windows Store apps. I will check your C and C# scenario and report back.

    Update: This stackoverflow thread offers good info on how to use old dlls (native and managed) in Windows Store Apps and how to check supported APIs in the .NET for Windows Store apps. If the DLLs are managed code, the list of support APIs can be found at MSDN.

    Friday, January 11, 2013 8:11 PM
  • Hi,

    Yes. You can use C dll or C methods in Windows Store apps. But not all the CRT functions are supported in WinRT.

    You could check this list:

    Windows Runtime Unsupported CRT Functions

    If you want to use the dll in C#, you have to use p/invoke.

    Here are some reference:

    http://www.pinvoke.net/


    Aaron
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Aaron Xue Monday, January 14, 2013 9:15 AM
    • Marked as answer by Srithar Tuesday, January 15, 2013 5:19 AM
    Monday, January 14, 2013 9:14 AM
  • Thanks a lot to everyone. Your suggestions are very useful. 

    srithar

    Tuesday, January 15, 2013 5:21 AM