Questions tagged [vb6-migration]

This tag is for questions about migrating existing applications, or legacy code, from Visual Basic 6 to a more modern platform. Unfortunately migration is usually a tricky task. The most common target platforms are VB.NET and C#.

Here are some typical motives for migration

  • To use a more modern programming language for enhancements.
    • This will give some increase in productivity.
    • This also keeps the developers happy, which is a valid business benefit in itself. There are bigger gains in productivity from attracting and retaining good developers than anything else.
  • To use a fully supported programming stack.
    • Although the VB6 runtime is still fully supported by Microsoft as part of Windows, many people worry that support will be dropped one day. The VB6 IDE is no longer supported.

Frequently asked questions

669 questions
5
votes
2 answers

Migrating from VB6 to .NET, is there an equivalent function for TreeNode.FirstSibling?

The desktop application I'm migrating makes heavy use of a TreeView control, and many calls to TreeNode.FirstSibling, e.g. 'UPGRADE_ISSUE: MSComctlLib.Node property tvTreeView.SelectedItem.FirstSibling was not upgraded. If…
brasskazoo
  • 76,030
  • 23
  • 64
  • 76
5
votes
2 answers

How to convert Application.PrevInstance in VB 6.0 to VB.NET?

I have 'Applications.PrevInstance' in VB 6 code that I am trying to upgrade to .NET using VS 2008. Apparently this code is no longer valid. Does anyone have any ideas about upgraded solution? TIA
Daniel Grindstaff
  • 105
  • 1
  • 2
  • 8
5
votes
3 answers

How can I share an interface between VB6 and C#?

I would like to be able to code a class interface which I can implement in C# and VB6 classes so that these classes can be handled in the same way within VB6 code but I can't make this work. In VB6 I want to have come class VB6Class using the…
DMFW
  • 53
  • 7
5
votes
1 answer

Excel VBA ADODB Late Binding error

Actually every time I am using the Early binding code to use the ADODB Connection , However now I want to use the Late Binding Code. According to me, it seems the code is perfect but I don't the how I am getting an error Like "Argument are of the…
Sarfaraz78615
  • 114
  • 1
  • 7
5
votes
1 answer

Property/Method Descriptions for COM Libraries

If you create a COMClass, I've noticed that the values in the XML Summary tag do not show in the object browser of VB6/VBA when you reference the resulting tlb file. Is there a way to have these values show up?
Oorang
  • 6,630
  • 1
  • 35
  • 52
5
votes
6 answers

Converting HDD Serial # VB6 code into VB.NET code

I've got a cool piece of code taken from a VC++ project which gets complete information of the hard disk drive WITHOUT using WMI (since WMI has got its own problems). I ask those of you who are comfortable with API functions to try to convert this…
TheAgent
5
votes
4 answers

Name 'Printer' is not declared VB6 to .NET

I am upgrading VB6 to .NET after the upgrade I get the compile error: Name 'Printer' is not declared My code in VB6 is something like this: THeight = Printer.TextHeight("#") What is the correct way to declare a printer in .NET? Note: I tried to…
nate
  • 1,418
  • 5
  • 34
  • 73
5
votes
3 answers

Convert vba to vb6 and create a .dll - how to - hints, tips and risks

I should convert a huge load of code which was written in VBA (Excel) to VB6. But I really do not know what I have to take care of or where to begin. Therefore it would be great to get some hints here from the VB6 experts. I installed already MS…
Thomas Kremmel
  • 14,575
  • 26
  • 108
  • 177
5
votes
2 answers

Equivalent for getobjectcontext() in visual studio 2012 vb.net?

I have a vb6 COM object that I am converting to VB.Net 2012 My sample code looks like below : Dim ObjContext ,objx ,objy As Object Dim Rs As ADODB.Recordset Set ObjContext = GetObjectContext Set objx =ObjContext.CreateInstance("abc.class1") Set…
5
votes
5 answers

VB6 to VB.net conversion

Exact duplicate: Best strategy for moving applications from VB6 to VB.Net Exact duplicate: Conversion tool comparisons for VB6 can any one please tell the tool which converts vb6 to vb.net thanks dagg
dagg
  • 99
  • 1
  • 1
  • 6
5
votes
1 answer

equivalent for vb6.Format function in vb.net without using Microsoft.Visualbasic.Compatibility.dll

Possible Duplicate: Is there a way to programmatically convert VB6 Formatting strings to .NET Formatting strings? during migration from vb6 to vb.net the Format$(1234567, "###,###,###,###") function is converted to…
ashish_pal
  • 217
  • 1
  • 4
  • 11
5
votes
3 answers

Resizing a 3D array

I am attempting to resize a 3D array in C#. The VB6 code reads: ReDim Combos(ProductNum, 4, 3) Since I cannot use Array.Resize for a 3D array, is there another way for me to do this function in C#? I have already declared the array as a 3D…
eric_13
  • 383
  • 1
  • 8
  • 22
4
votes
1 answer

Equivalent of "Open fileName For Output As #1" VB6 to .NET

Another migration question, I have another chunk of VB6 code that seems to need some workaround for .NET. For a shortened version, this is all it is doing: Open sFileName For Output As #1 Print #1, Print #1, "Facility:" & vbTab &…
Logan B. Lehman
  • 4,867
  • 7
  • 32
  • 45
4
votes
1 answer

C# DLL cannot affect value of a number passed by reference from a VB6 application

I have a legacy VB6 application that calls a VB6 DLL, and I am trying to port the VB6 DLL to C# without yet touching the main VB6 application code. The old VB6 DLL had one interface that received a VB6 long (32-bit integer) by reference, and…
edj
  • 523
  • 7
  • 17
4
votes
1 answer

Equivalent of "Get" statements VB6 to VB.NET 2022

I have some VB6 code that needs to be migrated to VB.NET, and I wanted to inquire about this lines of code, and see if there is a way to implement them in .NET. Get statements are no longer supported so how can I replace it? For i = 0 To ntc(j) - 1 …
MattL99
  • 137
  • 5