none
Convert Windows CE project to web RRS feed

  • Question

  • I have a Windows CE 5 winforms application. But I want to migrate to web application. I know it is not possible to automatically convert windows form to html, javascript etc. Manual work will be need.

    What I am asking is a way to preserve the existing code from the forms. Is there a way to map or connect contols from web application to the existing code of my WinCE app?

    For example, something like Web-Api using the code and a Web app comunicating with it. I will use ReactJS for the web app.

    My question is more about my existing code. For example, when I press a button on the web UI, a button_Clicked event is fired from my existing code. Or when my web form is loading, an event for data download from DB is fired and downloaded data is trnsferdto my web app UI. Is web-api capable of this?

    Any suggestions?


    • Edited by Iv54 Tuesday, January 30, 2018 11:06 AM
    Tuesday, January 30, 2018 11:00 AM

All replies

  • Web application and WinCE app are completely different. So you can't use much code also except may be data access code, but that also depends on which database you were using in WinCE. Rewrite the code for web app would be a preferable option. 

    Or when my web form is loading, an event for data download from DB is fired and downloaded data is trnsferdto my web app UI. Is web-api capable of this?

    You can create Web API to send request to WinCE app, download data and transfer to web app, but web api has to be hosted on your WinCE device, and I doubt WinCE device can handle it or not. 



    Gaurav Khanna | Microsoft MVP | Microsoft Community Contributor


    Tuesday, January 30, 2018 11:33 AM
  • What I am asking is a way to preserve the existing code from the forms. Is there a way to map or connect contols from web application to the existing code of my WinCE app?

    What code? Are you talking about business and database logic you have tightly coupled to the forms and controls that you should not be repeating in the Web forms? 

    My question is more about my existing code. For example, when I press a button on the web UI, a button_Clicked event is fired from my existing code. Or when my web form is loading, an event for data download from DB is fired and downloaded data is trnsferdto my web app UI. Is web-api capable of this?

    Yes that can happen that the UI or penetration layer calls the WebAPI for CRUD with the database.

    You can go ASP.NET MVC, or you can go ASP.NET Web form using MVP.

    https://www.codeproject.com/Articles/228214/Understanding-Basics-of-UI-Design-Pattern-MVC-MVP

    Here is a ASP.NET WebAPI tutorial that is also using MVC and Knockout.

    https://docs.microsoft.com/en-us/aspnet/web-api/overview/data/using-web-api-with-entity-framework/part-1

    You can post to the ASP.NET forums for more help.

    http://forums.asp.net/

    Tuesday, January 30, 2018 12:33 PM
  • Hello Iv54,

    >>Is there a way to map or connect contols from web application to the existing code of my WinCE app

    As far as I know, it doesn't exist a framework in .Net to meet your requirement driectly, for what you want, you need to create a custom interactive middle program which communicate between web application and existing code. The structure like as below image.

    What you need to do is to create a middle program, which responsibility is to convert the web request to winform event, and then get data, come back to response for web. The action will need a series of web communicates. And this also will take a lot of job to handle this.

    Best regards,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, January 31, 2018 6:17 AM
    Moderator
  • My WinCE app works on rugged devices. They have bacrode scanner and rfid scanner. This app communicates with another program that run on a local machine. This program works with database and does all the heavy logic. After all the computation the ready data is transfered to my app.

    My plan is to migrate to Android devices. But doing the app from the scratch is not an option now. For that a web app with UI only will work.

    I thought of running my existing WinCE on server in emulator or something like that, creating a web-api server to communicate in some way with this app and of course the web-app that sends requests to the web-api server.

    Is this possible? Can I use peripherals through web app?


    • Edited by Iv54 Wednesday, January 31, 2018 10:19 AM
    Wednesday, January 31, 2018 10:16 AM
  • I thought of running my existing WinCE on server in emulator or something like that, creating a web-api server to communicate in some way with this app and of course the web-app that sends requests to the web-api server.

    Is this possible? Can I use peripherals through web app?

    You can put the business and DB logic in the Repository pattern object  that the WebAPI has reference to, and from that point, any type of client Windows form, Web form, Windows service,  ect., ect. can consume the WebAPI.  But peripheral devices is a maybe.

    You can post to the forum that has people that can help you.

    https://forums.asp.net/1246.aspx/1?Web+API
    Wednesday, January 31, 2018 11:18 AM