Break VB6 project into chunks to use free version of Artinsoft

后端 未结 2 608
萌比男神i
萌比男神i 2021-01-29 13:45

I am trying to convert a large (200K lines) VB6 project into C#. I only want to convert the form design because I want to rewrite all the actual code in C#.

I want to us

相关标签:
2条回答
  • 2021-01-29 14:08

    I will try it in following order

    1) Write automated test cases at least for major business operations

    this will save you a lot of bother verifying the results later on.

    2) Refactor your VB (try to move out your business logic in separate Classes/DLLs).

    3) you can verify your re-factoring using automated test cases written in step 1.

    4) Now you have small chunks this will also help you create chunks then you can use Artinsoft.

    5) Your new C# application will be nicely layered.

    6) Run tests created in step 1 on your new application and on your old application and compare results and keep improving unless they match :)

    0 讨论(0)
  • 2021-01-29 14:12

    I would advise against using a converter for the UI. It may seem trivial, but there are features that simply do not natively exist in .NET (control arrays without a wrapper for a big one). And the control wrappers it creates are not fun to use nor maintain.

    VB6 does not port well; the UI nor the code. If you were to continue down this path, there are things that can help.

    1. Remove all unused forms and code
    2. Ensure there are no control arrays and if there are, correct related code
    3. Get all logic wrapped in classes
    4. Ensure you are not calling/loading/referencing forms directly and that you are using an instantiated object
    5. Ensure good encapsulation practices are in use and good object oriented design patterns

    I would seriously reconsider conversion. Converted code/UI sounds great, but in my bad experiences with VB6 conversion, there are so many problems because of how bad VB6 allowed developers to be and features that simply don't exist anymore.

    Do yourself a huge favor... Start a new project, create a custom control library that inherits from the standard controls you use, and use those everywhere. Don't like the way Cliptext works on a masked textbox in C# versus VB6? Extend it or override it. Want all your listviews to be sortable? Easy, single-point implementation. Find out in a year that the business wants spell checking on 90% of textboxes? Easy.

    0 讨论(0)
提交回复
热议问题