3

Using classes from the Microsoft.VisualBasic.Compatibility.VB6 namespace in a .NET Framework 4+ project yields the following warning:

Warning BC40000: <Class name> is obsolete: 'Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. http://go.microsoft.com/fwlink/?linkid=160862

The project uses the classes LabelArray, TextBoxArray and PictureBoxArray as well as the methods Format, SetItemData and GetItemData from the Support module.

I'm aware that these classes are remnants of the VB6->VB.NET conversion wizard available in ancient Visual Studio versions and should not be used for new development. I am also aware that "not supported" means that I'm on my own if anything breaks.

That having been said, I am trying to assess the risk of switching an old legacy library that still uses those classes from x86 to AnyCPU, so that it can be used in a 64 bit host application. According to some preliminary tests, everything just "seems to work".

Apart from not being officially supported, are there any concrete known issues with using classes from the Microsoft.VisualBasic.Compatibility.VB6 namespace in a 64 bit process?

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Heinzi
  • 167,459
  • 57
  • 363
  • 519
  • "Not supported" doesn't mean "won't work", it means "don't call us when you have a problem". It was the runtime library for the upgrade wizard in VS2008. Not a success, removed again in VS2010. The trouble Microsoft doesn't want to hear about is the vb6 code that the wizard did not address, Declare statements in particular. – Hans Passant Apr 12 '22 at 17:05
  • @HansPassant: That's what I thought. On the other hand, Declare statements should not affect the compatibility UI elements in the Conversion namespace. Basically, I just want to confirm whether it's (a) *"we didn't test this with 64 bit, so don't bother us if it doesn't"* or (b) *"we know our code is broken with 64 bit and does some nasty things, but we don't want to fix it"*. – Heinzi Apr 12 '22 at 17:14
  • @Heinzi Effectively both. Go ahead and try it, but expect problems, especially if you're dabbling with 64bit numbers. – Davesoft Apr 13 '22 at 13:25

0 Answers0