-------------------------------------------------------------------------------
Sample Name: MasterMind

Description: A simple MasterMind game, where you guess the hidden color 
             combination chosen by the computer. Messages are in Italian, but 
             can easily guess what they mean. A black dot in the result pane 
             means that you’ve guessed a color in the right position, whereas 
             a white dot means that the color is in the solution but it’s found 
             in a different position. It’s a lot of code (over 4000 lines), 
             but we needed just two pragmas to have it run correctly after the 
             migration to VB.NET.

Download URL: http://digilander.libero.it/vettolani/sorgenti/visual_basic_vb_sorgenti_programmi_guide_esempi_source_code.html
-------------------------------------------------------------------------------

IMPORTANT NOTE
The first step to ensure that you can migrate the VB6 project to VB.NET is 
loading the original project in the Visual Basic 6 IDE, run it to ensure that 
it works fine, that all the required type libraries are installed, and that all 
file paths are correct. 
Regardless of whether you edited the source code in any way, you should save 
the VB6 project: this save operation ensures that the .vbp file includes  
the correct path and version of referenced type libraries. 
After saving the project, it's usually a good idea to compile the VB6 project
to an executable, to detect any VB6 compilation errors that would appear under 
VB.NET as well. 
(If you don't recompile the project VB Migration Partner will display a warning 
when you later load the project.)


Migrating the original VB6 code generates a VB.NET project that has nine
compilation errors. A quick glance shows that all of them are caused by
a Label control named "New". While VB6 accepts controls whose name is equal
to a language keyword, such names are forbidden in VB.NET.

You can use a SetName pragma to manually assign a different name to the control.
Add the pragma at the top of Form1 file:

'##New.SetName lblNew

The SetName pragma solves the compilation error, but the generated VB.NET
solution throws an exception at runtime. The exception is caused by a 
variable named "Colore", which is mistakenly declared as a String and causes
a TypeMismatch exception when the variable is passed to a method that 
expects an integer. The workaround for this problem is using a SetType pragma
to force a different type to the for the variable. Add the pragma 
in Form1:

'##Colore.SetType Integer
Dim Colore as String


Now you can run the sample and enjoy playing Master Mind!
