locked
Porting Win32 libraries to WinRT

    Question

  • Hi !

    I have legacy win32 static library which I want to port to WinRT so that I can use that in ARM based processors with metro style apps as well as desktop apps.

    After going through some links what I understand is there are two modes of API that comes with Windows8.

    (1) Desktop

    In desktop API's what I see is upgraded and new set of functions included like for example,  FindFirstFileEx instead of FindFirstFile.

    This works only in desktop mode but both in ARM as well as Intel processors.

    (2) WinRT object oriented classes.

    These are what given in  <<removed link>> and in order to replace my old win32 static library functionality I need to rewrite almost all the code.

    For example : SHGetFolderPath, CreateThreads , Critical Section etc.

    Also, my old Win32 Static Library is in C and in order to achieve full flexibility I need to re write new WinRT code in C++.

    Please correct me if I am wrong in any of my assumptions. 

    Appreciating your help in advance.

    Thanks And Regards,

    Sravan Vurapalli

    Tuesday, November 27, 2012 3:18 PM

Answers

  • Hi Sravan Vurapalli,

    I think you are almost right. Despite this I would like to add some more...

    Actually MS has bought two generic type of environment in Windows 8. One is for typical  Desktop Apps and another one is for Windows Store apps. As Windows 8 support both type of apps, partition all APIs mainly in two category which lays in winapifamily.h (c++) header file. Here some APIs is only for Desktop Apps, some APIs only for Windows Store apps and some for both.

    As Windows Store apps is a new type of apps there are some remarkable changes in windows APIs like Networking, System, Registry, Storage etc. WinRT is the backbone of Windows store apps and it behaves as........

    • Asynchronously
    • Object Oriented
    • COM based C++
    • Run in a sandbox ( Appx package directory )
    • Similar to Silverlight

    There are a large number of Win32 APIs has been replaced by the new WinRT library and a good number of Win32 APIs will not be available. So you have to re-write some modules which contain deprecated platform dependent APIs. Remember that, all standard C++ is also supported as earlier, so there is no changes in business logic at your legacy code.

    You can get more ideas from following references....

    CRT functions not supported with /ZW

    Alternatives to Windows APIs in Windows Store apps

    API reference for Windows Store apps

    Static libraries (C++/CX)




    • Edited by Mokarrom Hossain Tuesday, November 27, 2012 6:08 PM
    • Proposed as answer by Jesse Jiang Thursday, November 29, 2012 2:39 AM
    • Marked as answer by Jesse Jiang Tuesday, December 04, 2012 2:24 AM
    Tuesday, November 27, 2012 6:07 PM
  • I have an article that focuses on game engine libraries, but it does provide some general guidance for writing 'dual-use' code that can compile for both Win32 desktop applications and Windows Store apps

    Dual-use Coding Techniques for Games

    • Marked as answer by Jesse Jiang Tuesday, December 04, 2012 2:24 AM
    Wednesday, November 28, 2012 8:22 PM

All replies

  • Hi Sravan Vurapalli,

    I think you are almost right. Despite this I would like to add some more...

    Actually MS has bought two generic type of environment in Windows 8. One is for typical  Desktop Apps and another one is for Windows Store apps. As Windows 8 support both type of apps, partition all APIs mainly in two category which lays in winapifamily.h (c++) header file. Here some APIs is only for Desktop Apps, some APIs only for Windows Store apps and some for both.

    As Windows Store apps is a new type of apps there are some remarkable changes in windows APIs like Networking, System, Registry, Storage etc. WinRT is the backbone of Windows store apps and it behaves as........

    • Asynchronously
    • Object Oriented
    • COM based C++
    • Run in a sandbox ( Appx package directory )
    • Similar to Silverlight

    There are a large number of Win32 APIs has been replaced by the new WinRT library and a good number of Win32 APIs will not be available. So you have to re-write some modules which contain deprecated platform dependent APIs. Remember that, all standard C++ is also supported as earlier, so there is no changes in business logic at your legacy code.

    You can get more ideas from following references....

    CRT functions not supported with /ZW

    Alternatives to Windows APIs in Windows Store apps

    API reference for Windows Store apps

    Static libraries (C++/CX)




    • Edited by Mokarrom Hossain Tuesday, November 27, 2012 6:08 PM
    • Proposed as answer by Jesse Jiang Thursday, November 29, 2012 2:39 AM
    • Marked as answer by Jesse Jiang Tuesday, December 04, 2012 2:24 AM
    Tuesday, November 27, 2012 6:07 PM
  • I have an article that focuses on game engine libraries, but it does provide some general guidance for writing 'dual-use' code that can compile for both Win32 desktop applications and Windows Store apps

    Dual-use Coding Techniques for Games

    • Marked as answer by Jesse Jiang Tuesday, December 04, 2012 2:24 AM
    Wednesday, November 28, 2012 8:22 PM