locked
About Metro style app call win32 static lib

    Question

  •     According to the Metro doc, some win32 API can't be used by Metro style app. Fox example, win32 socket API will be replaced by Windows.Networking.Sockets. I try it and it's true: include WinSock2.h and declare the WSA struct object, compile it and get error.

        But when I use a win32 static lib to encapsulate the win32 socket API calling(just test creating a socket by calling WSASocket function), and metro app link this lib and call the exported function, it can work. Does Metro really support this kind of calling. Does is mean that if Metro app can't call some win32 API directly, we can encapsulate it to a win32 static lib and use it?

    Tuesday, July 17, 2012 11:21 AM

Answers

  • Calling unsupported Win32 API from a Metro style app is unsupported, even if they are linked in via a static library. Doing so will bypass the compile time checks, but the app will still fail certification and not be allowed into the store.

    Depending on the specific API and usage it may or may not work if installed without going through the store.

    --Rob

    Wednesday, July 18, 2012 4:48 AM
    Owner

All replies

  • Hello,

    Please go through the following discussion.

    Its regarding the usage of static lib from Metro.

    http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/4fa636f6-123d-4826-a0ee-e6200d8bface

    You can link to static lib.

    I have used static lib of DICOM tool kit  from Metro application.

    DICOM library uses sockets for network communication.

    One thing I noted is that you can make socket connection to any servers(Desktop application) from Metro app.

    But a Metro application could not able to stay as a Server for Desktop application.

    Thanks,

    Bhash

    Tuesday, July 17, 2012 2:54 PM
  • BhashTech

        Thanks for the replay.

    Wednesday, July 18, 2012 2:21 AM
  • Calling unsupported Win32 API from a Metro style app is unsupported, even if they are linked in via a static library. Doing so will bypass the compile time checks, but the app will still fail certification and not be allowed into the store.

    Depending on the specific API and usage it may or may not work if installed without going through the store.

    --Rob

    Wednesday, July 18, 2012 4:48 AM
    Owner