Prova a sostituire MsgBox con MessageBox.Show.
Amaro C++, il gusto pieno dell'undefined behavior.
Regole del Forum