how hard to rewrite a legacy software from C++ to C# in WinForm?
-
Don't fear the reaper... ... just start re-writing the code. For smaller parts you can use https://www.codeconvert.ai/c++-to-csharp-converter[^] But you have to revise this converted code anyway.
:rose::rose::rose:
diligent hands rule....
-
It's easy. Start a new project in the target language of your choice. Copy the bare minimum from the source language, paste it in the new language target husk, and attempt to compile. You'll get tons of errors and warnings. Pick through them and eliminate them one-by-one. Obviously there's a lot of personal experience in "attempting" to do anything using a compiler and a linker. Done this, have I. Learned much have I.
This is exactly how I converted about 10,000 lines of VB6 code to VB 2005. The biggest changes were file handling and error reporting. To this day I'll occasionally use On Error Resume Next in short Subs and Functions when it's appropriate. Otherwise I use Try/Catch/Finally.
-
This is exactly how I converted about 10,000 lines of VB6 code to VB 2005. The biggest changes were file handling and error reporting. To this day I'll occasionally use On Error Resume Next in short Subs and Functions when it's appropriate. Otherwise I use Try/Catch/Finally.
-
This is exactly how I converted about 10,000 lines of VB6 code to VB 2005. The biggest changes were file handling and error reporting. To this day I'll occasionally use On Error Resume Next in short Subs and Functions when it's appropriate. Otherwise I use Try/Catch/Finally.
obermd wrote:
To this day I'll occasionally use On Error Resume Next
as long as you put something in between... :rolleyes: ;P :laugh:
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
-
I have a legacy software to draw very sophisticated charts. but I only need a small piece of these charts. I want to re-write the code charting this small piece of charts. How hard it is to do this? any experience to share?
diligent hands rule....
Outsource to someone here (me?).
-
I have a legacy software to draw very sophisticated charts. but I only need a small piece of these charts. I want to re-write the code charting this small piece of charts. How hard it is to do this? any experience to share?
diligent hands rule....
Does it 'need' to be C#? Or can you use C++/CLI? Because the latter would be much simpler, in the sense that you can keep your algorithms and the back end stuff in C++, and do the user interface in C++/CLI. Is your user interface in MFC, or WTL or something else? The user interface would have to be re-built from scratch
-
I have a legacy software to draw very sophisticated charts. but I only need a small piece of these charts. I want to re-write the code charting this small piece of charts. How hard it is to do this? any experience to share?
diligent hands rule....
You're going to have to rewrite UI code regardless. The one advantage going to WinForms would be correspondence in the UI. WinForms is something of a wrapper around Windows GDI controls for C#, in the same sense that MFC is a wrapper for C++.
Software Zen:
delete this;
-
I have a legacy software to draw very sophisticated charts. but I only need a small piece of these charts. I want to re-write the code charting this small piece of charts. How hard it is to do this? any experience to share?
diligent hands rule....
In my experience of rewriting from one language into C#, there are a few principles I applied that helped me. 1 - Understand the requirements, architecture, and intent of the original code (which may have to be determined with only the original code at hand). 2 - Understand WHAT the original code is doing. 3 - In the new language (e.g. C#), determine how it best does what the original code did. Just translating code from original to new is a trap. 4 - What does the new language offer (including third party components if you want) that would be useful, that was not used for the original app with the original language? 5 - What new language architecture gives you the lowest total SDLC cost with the best acceptable performance, scalability, and support? Apply these principles and you will avoid a myriad of booby-traps and sloughs of despond.
-
I have a legacy software to draw very sophisticated charts. but I only need a small piece of these charts. I want to re-write the code charting this small piece of charts. How hard it is to do this? any experience to share?
diligent hands rule....
Isn't it better to use an existing product? Have you looked at ScottPlot ?
Behzad
-
I have a legacy software to draw very sophisticated charts. but I only need a small piece of these charts. I want to re-write the code charting this small piece of charts. How hard it is to do this? any experience to share?
diligent hands rule....
-
I have a legacy software to draw very sophisticated charts. but I only need a small piece of these charts. I want to re-write the code charting this small piece of charts. How hard it is to do this? any experience to share?
diligent hands rule....
-
It's easy. Start a new project in the target language of your choice. Copy the bare minimum from the source language, paste it in the new language target husk, and attempt to compile. You'll get tons of errors and warnings. Pick through them and eliminate them one-by-one. Obviously there's a lot of personal experience in "attempting" to do anything using a compiler and a linker. Done this, have I. Learned much have I.
-
I have a legacy software to draw very sophisticated charts. but I only need a small piece of these charts. I want to re-write the code charting this small piece of charts. How hard it is to do this? any experience to share?
diligent hands rule....
There are good charting controls available off the shelf for WPF, maybe for winforms but just go WPF. If those just won't do, you probably want to look for "using GDI+ from WPF" if you're looking to draw your own charts. If you're really wanting to visualize data in interesting ways, it might not be insane to look into using Unity. Custom rendering with GDI+ is.... hard to get a positive return on investment unless you're a company that sells components for WinForm/WPF.
-
obermd wrote:
To this day I'll occasionally use On Error Resume Next
as long as you put something in between... :rolleyes: ;P :laugh:
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
-
On Error Resume Next is really useful for short clean up routines where the code would look like this
try {statement1} catch {}
try {statement2} catch {}
...what (empty catch blocks) actually is something I do not like, have already lost some precious time tracking down things done by people thinking it is not needed.
M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.