Porting a .bas file to vb.net

I am working on some outdated VB5 / VB6 code and should convert the .bas file to vb.net.

I found some options

  • Compile the .bas file into com dll, and then link and use it in my project. (For this, I assume that I will need vb5 or vb6, which I do not have)

  • Copy and paste the contents of the file into a new module in vb.net, and then try to resolve the errors one by one.

The contents of the .bas file refers to a specific dll. The .bas file contains mostly declarations of consts, types, sub and functions.

What will be the most elegant way to remake this in vb.net. It is as simple as option 2.

EDIT

I used VS2008 express and ran the code through the update wizard, it did the necessary conversion. and the .bas file has been converted to .vb. I took this file and decided to rewrite other parts of the code, including some repeated conversions of the converted .vb file.

Other questions related to this are here .

+3
source share
3 answers

Consider rewriting as an alternative. In my experience, in the long run, this does less work than using the opaque COM library or using the VB6 migration wizard and collecting the fragments that it spits out.

.NET VB6 . .NET, , .NET.

+6

Microsoft , , , VB6 .NET.

, 2, .

, VB6 .

, VB6, , .

+1

vb.net - (, , ) . DLL , , .

If the code is now in a VB6 project, or if it can be added to one, you can open the .vbp project file with vb.net and it will ask if you want to automatically convert it to vb. network. This is a good job, except for third-party add-ons.

+1
source

Source: https://habr.com/ru/post/1793618/


All Articles