locked
DLL (which uses winsock2.h) used in metro style app?

    Question

  • Development environment:
    Windows 8 Release Preview (build 8400)
    Visual Studio 2012 Express RC for Windows 8

    We want to build a metro style app. In our application we have to use a DLL library whose source is available to us. We could not build the DLL in the above environment, so compiled it on Windows 8(build 8250) with VS 2011 Beta. This DLL library uses desktop family libraries such as winsock2.h.

    Can we use that DLL in metro style app?

    SHOULD we use that DLL in metro style app?

    If yes, is it the same as desktop app? or we need to do something different for metro-style app?

    Tuesday, July 03, 2012 4:44 AM

Answers

  • That app won't pass store certification if it uses non-Metro compatible Win32 api. You need to build all code in a Metro style app that is destined for the store with the preprocessor define WINAPI_FAMILY=WINAPI_FAMILY_APP. Any api that don't compile will need to be replaced with WinRT library functional equivalents.

    Tuesday, July 03, 2012 9:18 PM
    Moderator
  • According to our observation we figure out that, winsock2.h is not available at Windows 8 Release Preview (build 8400) but available at Windows 8 Consumer Preview (build 8250).

    Is it missing at build 8400 and will be available at subsequent official release or intentionally deprecated ?

    If intentionally deprecated what is the equivalent of winsock2.h ?

    How could we rewrite our socket related event without using winsock2.h ?

    Winsock is not supported. If you look at this page:

    http://msdn.microsoft.com/en-us/library/windows/apps/hh464945.aspx

    The alternative suggested is to use the Windows.Networking.Sockets namespace:

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.sockets.aspx


    http://blog.voidnish.com

    Thursday, July 05, 2012 4:37 PM
  • PM for BOTH Winsock and the Windows.Networking.Sockets here:

    To be clear, you can't use Winsock in your App Store app; as was mentioned, it won't pass certification.  But if you're making a desktop app, or a server app, it's not only supported in Windows 8, but we've added new features.

    If you make an App store app--> use Windows.Networking.Sockets

    If you make a desktop or server app --> use winsock or other network APIs


    Network Developer Experience Team (Microsoft)

    Saturday, July 14, 2012 2:26 AM

All replies

  • That app won't pass store certification if it uses non-Metro compatible Win32 api. You need to build all code in a Metro style app that is destined for the store with the preprocessor define WINAPI_FAMILY=WINAPI_FAMILY_APP. Any api that don't compile will need to be replaced with WinRT library functional equivalents.

    Tuesday, July 03, 2012 9:18 PM
    Moderator
  • According to our observation we figure out that, winsock2.h is not available at Windows 8 Release Preview (build 8400) but available at Windows 8 Consumer Preview (build 8250).

    Is it missing at build 8400 and will be available at subsequent official release or intentionally deprecated ?

    If intentionally deprecated what is the equivalent of winsock2.h ?

    How could we rewrite our socket related event without using winsock2.h ?

    Thursday, July 05, 2012 11:12 AM
  • According to our observation we figure out that, winsock2.h is not available at Windows 8 Release Preview (build 8400) but available at Windows 8 Consumer Preview (build 8250).

    Is it missing at build 8400 and will be available at subsequent official release or intentionally deprecated ?

    If intentionally deprecated what is the equivalent of winsock2.h ?

    How could we rewrite our socket related event without using winsock2.h ?

    Winsock is not supported. If you look at this page:

    http://msdn.microsoft.com/en-us/library/windows/apps/hh464945.aspx

    The alternative suggested is to use the Windows.Networking.Sockets namespace:

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.sockets.aspx


    http://blog.voidnish.com

    Thursday, July 05, 2012 4:37 PM
  • PM for BOTH Winsock and the Windows.Networking.Sockets here:

    To be clear, you can't use Winsock in your App Store app; as was mentioned, it won't pass certification.  But if you're making a desktop app, or a server app, it's not only supported in Windows 8, but we've added new features.

    If you make an App store app--> use Windows.Networking.Sockets

    If you make a desktop or server app --> use winsock or other network APIs


    Network Developer Experience Team (Microsoft)

    Saturday, July 14, 2012 2:26 AM