VB 2008.express + Windows.Vista = disaster * totalfailure

Cybert543

New member
Joined
Feb 17, 2009
Messages
4
Programming Experience
Beginner
Something is wrong.
Durring game play of a game I am designing, I recieve a lovely crashing event in which my computer tells me that "vshost" has stopped working. Also, i get a message after debuging that tells me the problem is due to a compatability error between my version of windows and the version of C++ that is running. I was not aware C++ was running. Can anyone offer any explanation for this? I will gladly share the code and the game with anyone interested. So far both computers that I have attempted to play the game on ultimately ends in a crashing vshost or windowsapplication1 but the second computer was able to run the game smoothly for much longer.
Thanks everyone!:p


and thanks for nothin vb2008 express :mad:

If anyone wants to try the game on your own system I will e-mail it to you, (small file) 4.7 mb
I'm curious to know if it will crash on every computer
 
Last edited:
As a side note I use Vista SP1

Here a section of the code that durring opperation causes the game to crash maybe someone can help, I'm still new and I understand this may not be the most effecient code that it can be.
durring the battle portion of this RPG style game I use a button click to operate a random event that leads your character to a set of possible outcomes, This is the first 2 random outcomes. one positive and one negative. It shows a sucession of pictures separated by pauses from the thread.sleep() with sounds to represent a very basic form of animation like moves.
VB.NET:
Private Sub melee_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles melee.Click



        melee.Enabled = False
        


        Dim random2 As New Random()

        Dim ran2 As Integer = random2.Next(1, 7)

        If ran2 = 1 Then
            enemy1.Hide()

            enemy1fast.Show()

            Dim soundplayer1 As New Media.SoundPlayer(My.Resources._throw)
            soundplayer1.Play()



            Dim Increment As Integer = 1
            Dim R, G, B As Integer
            R = 0
            G = 0
            B = 0
            Label9.BackColor = Color.Black
            Application.DoEvents()
            For i As Integer = 30 To 70
                R += Increment
                B += Increment
                G += Increment
                Label9.BackColor = Color.FromArgb(R, G, B)
                Application.DoEvents()
                System.Threading.Thread.Sleep(10)
            Next
            enemy1fast.Hide()
            enemy1hit.Show()
            gethit1.Show()
            Player1.Hide()

            Dim soundplayer2 As New Media.SoundPlayer(My.Resources.strongpunch)
            soundplayer2.Play()


            R = 0
            G = 0
            B = 0
            Label9.BackColor = Color.Black
            Application.DoEvents()
            For i As Integer = 1 To 40
                R += Increment
                B += Increment
                G += Increment
                Label9.BackColor = Color.FromArgb(R, G, B)
                Application.DoEvents()
                System.Threading.Thread.Sleep(10)
            Next

            hplabel.Text -= 50
            hplabel2.Text -= 50
            enemy1hit.Hide()
            gethit1.Hide()

            enemy1.Show()

            If hplabel2.Text < 1 Then

                playerdead.Show()

                Dim soundplayer0 As New Media.SoundPlayer(My.Resources.deathfall)
                soundplayer0.Play()

                R = 0
                G = 0
                B = 0
                Label9.BackColor = Color.Black
                Application.DoEvents()
                For i As Integer = 1 To 40
                    R += Increment
                    B += Increment
                    G += Increment
                    Label9.BackColor = Color.FromArgb(R, G, B)
                    Application.DoEvents()
                    System.Threading.Thread.Sleep(10)
                Next


                MessageBox.Show("you died!", "dead", MessageBoxButtons.OK)
                Level1.Close()
                Mygame.Show()
                Me.Close()

            End If
            Player1.Show()
        End If

        'second randome chance of melee outcome positive

        If ran2 = 2 Then

            Player1.Hide()
            hit2.BringToFront()
            hit2.Left = 520
            fastmove.Show()


            Dim soundplayer1 As New Media.SoundPlayer(My.Resources.teleport)
            soundplayer1.Play()

            Dim Increment As Integer = 1
            Dim R, G, B As Integer
            R = 0
            G = 0
            B = 0
            Label9.BackColor = Color.Black
            Application.DoEvents()
            For i As Integer = 50 To 70
                R += Increment
                B += Increment
                G += Increment
                Label9.BackColor = Color.FromArgb(R, G, B)
                Application.DoEvents()
                System.Threading.Thread.Sleep(10)
            Next
            enemy1.Hide()
            fastmove.Hide()
            hit2.Show()
            cellhit.Show()
            enemyhp.Text -= playerdmg1.Text

            Dim soundplayer3 As New Media.SoundPlayer(My.Resources.strongkick)
            soundplayer3.Play()

            R = 0
            G = 0
            B = 0
            Label9.BackColor = Color.Black
            Application.DoEvents()
            For i As Integer = 30 To 70
                R += Increment
                B += Increment
                G += Increment
                Label9.BackColor = Color.FromArgb(R, G, B)
                Application.DoEvents()
                System.Threading.Thread.Sleep(10)
            Next


            cellhit.Hide()
            hit2.Hide()
            Player1.Show()
            If enemyhp.Text < 1 Then
                enemy1dead.Show()

                Dim soundplayer6 As New Media.SoundPlayer(My.Resources.deathfall)
                soundplayer6.Play()

                R = 0
                G = 0
                B = 0
                Label9.BackColor = Color.Black
                Application.DoEvents()
                For i As Integer = 30 To 70
                    R += Increment
                    B += Increment
                    G += Increment
                    Label9.BackColor = Color.FromArgb(R, G, B)
                    Application.DoEvents()
                    System.Threading.Thread.Sleep(10)
                Next

                MessageBox.Show("You have defeated The enemy!  You found $200 and your power level grew by 1000.", "victory", MessageBoxButtons.OK)
                bplabel.Text += 1000
                playerdmg1.Text += 3
                playerdmg2.Text += 7
                playerdmg3.Text += 11
                playerdmg4.Text += 16
                money.Text += 200

                enemy1dead.Hide()

                Level1.Show()
                l1.hp.Text = Me.hplabel.Text
                l1.mp.Text = Me.mplabel.Text
                l1.bp.Text = Me.bplabel.Text
                l1.water1.Text = Me.watercounter.Text
                l1.food1.Text = Me.foodcounter.Text
                l1.pd1.Text = Me.playerdmg1.Text
                l1.pd2.Text = Me.playerdmg2.Text
                l1.pd3.Text = Me.playerdmg3.Text
                l1.pd4.Text = Me.playerdmg4.Text
                l1.cash.Text = Me.money.Text

                l1.con()


                Me.Close()

            End If
            enemy1.Show()
        End If
 
Last edited by a moderator:
Back
Top