Se vi piace il mio sito e volete fare una donazione:
If you like my website and you want to make a donation:
Deadlock migrating Visual Basic 6.0 project to Visual Basic 2005
Introduction:
Recently I tried to perform a migration of a Visual Basic 6.0 project to Visual Basic 2005 and I encountered a deadlock problem in the Microsoft Upgrade Wizard. Here there is the solution I have found for this annoying problem.
Problem description:
Opening a Visual Basic 6.0 project with Microsoft Visual Studio 2005 causes the Upgrade Wizard to ask for project conversion. Trying to convert one of my projects I experienced a deadlock of the wizard during the preprocessing phase of some of the classes, modules and forms. The wizard window seems not to be hanged because the conversion routine is running on a separate thread, but if you let the converter work on this "corrupted" file you can observe (using task manager) a memory leak and a progressive increasing of the data swapped for the wizard process. I have done a big investigation on the reason of this problem comparing the three project files that was affected by this issue an finally I found the cause of this problem.
Cause:
As you probably know in visual basic a Select/Case block is written as follows:
Select Case MyVar Case 1 ..... ..... Case 2 ..... ..... Case 3 ..... ..... End Select
And this equals to:
Select Case MyVar
Case Is = 1 ..... ..... Case Is = 2 ..... ..... Case Is = 3 ..... ..... End Select
The problem is that the wizard seems to misunderstand the second coding way in the case you have several nested Select/Case blocks.
Solution:
The solution that I have found for my project is to remove all the "Is =" from the Case sentences (the code meaning remains the same) and than the conversion was able to go through the "corrupted" files correctly. I've not investigated if the problem is present also with other "Is" statements like "Is >", "Is < ", ...., but may be that also this ones are affected by this malfunction.