locked
Is _beginthreadex permitted in WinRT DLL which runs in background thread

    Question

  •  According to MSDN API documentation _beginthreadex() and its co is not allowed in metro, but till i can use it metro style apps ( Win. 8 RP (8400) with VS2012 exp RC ).   Why ???

    Is there any chance to ban completely these APIs in final version of Windows 8 ?

    Is it possible to use these APIs to build a DLL which is consumed by WinRT/metro style apps ?

    Monday, September 10, 2012 4:57 PM

Answers

  • This function is now longer available in Windows 8 RTM build, I needed to fix my libraries.

    If you use this function in one of the external DLL's, I think you won't pass the certification step done by Windows App Cert Kit.

    Monday, September 10, 2012 6:58 PM
  • Hello,

    If you want to create thread in Windows store app, I would suggest you to use Windows.System.Threading namespace
    http://msdn.microsoft.com/library/windows/apps/BR229642

    Please follow the sample codes of it.
    http://code.msdn.microsoft.com/windowsapps/Pool-Sample-5aa60454

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Proposed as answer by Jesse Jiang Monday, September 17, 2012 3:18 AM
    • Marked as answer by Mokarrom Hossain Monday, September 24, 2012 2:57 PM
    Tuesday, September 11, 2012 5:50 AM
  • This issue is resolved after upgrading OS at Windows 8 RTM.

    _beginthreadex is a desktop family library and it is completely deprecated in Windows store apps.

    In Windows 8 Release Preview (build 8400), unfortunately _beginthreadex go out of #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP conditions. That's why it can be used. In  Windows 8 RTM (build 9200),  this problem is resolved and _beginthreadex & its co are no longer available.

    If any Windows store apps use _beginthreadex it can not pass the store certification.

     Windows.System.Threading  namespace is an alternative workaround.


    Monday, September 24, 2012 3:14 PM

All replies

  • This function is now longer available in Windows 8 RTM build, I needed to fix my libraries.

    If you use this function in one of the external DLL's, I think you won't pass the certification step done by Windows App Cert Kit.

    Monday, September 10, 2012 6:58 PM
  • Hello,

    If you want to create thread in Windows store app, I would suggest you to use Windows.System.Threading namespace
    http://msdn.microsoft.com/library/windows/apps/BR229642

    Please follow the sample codes of it.
    http://code.msdn.microsoft.com/windowsapps/Pool-Sample-5aa60454

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Proposed as answer by Jesse Jiang Monday, September 17, 2012 3:18 AM
    • Marked as answer by Mokarrom Hossain Monday, September 24, 2012 2:57 PM
    Tuesday, September 11, 2012 5:50 AM
  • This issue is resolved after upgrading OS at Windows 8 RTM.

    _beginthreadex is a desktop family library and it is completely deprecated in Windows store apps.

    In Windows 8 Release Preview (build 8400), unfortunately _beginthreadex go out of #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP conditions. That's why it can be used. In  Windows 8 RTM (build 9200),  this problem is resolved and _beginthreadex & its co are no longer available.

    If any Windows store apps use _beginthreadex it can not pass the store certification.

     Windows.System.Threading  namespace is an alternative workaround.


    Monday, September 24, 2012 3:14 PM