Results 1 to 6 of 6

Thread: [02/03] BIG Problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    6

    [02/03] BIG Problem

    Allow me to skip right to the point:

    Whenever I press Debug on ANY code, it gives me this box:



    If I press Break, it either freezes the program or returns me to the code.

    Cancel returns me to the code.


    Continue gives me the second text box. All the other text boxes just bring me back to the code.

    This happens to ALL of the code, and all of them were stable just after last night when I tried to debug this code:

    Code:
    Function singNeverEndingSong()
    ' this will erase any text presently in the outputBox
    outputBox.Text = ""
    Dim outputText As String = ""
    Dim loopCounter As Integer = 0
    For loopCounter = 1 To 10
    outputText = " This is the song that never ends, ... because.."
    outputBox.AppendText(outputText + vbNewLine)
    Next
    End Function
    The main problem is that nothing works anymore. I need to use VB03 for school, so up/downgrading is not an option.

    I can't reinstall: I don't have the disks.

    I tried to download mscorlib.dll from Google, with no luck.

    Attached is my current mscorlib.dll file.

    Also, since I can do nothing unless I can get this fixed, here's a video of EXACTLY what happens.

    http://0thingstodo.googlepages.com/help.htm

    }
    Attached Files Attached Files
    Last edited by Oyurcopsui; Sep 11th, 2008 at 06:39 PM.

  2. #2

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    6

    Re: [02/03] BIG Problem

    System Specs:

    Code:
    ------------------
    System Information
    ------------------
    Time of this report: 9/11/2008, 17:29:10
           Machine name: MALIK-PC1993
       Operating System: Windows Vista™ Home Basic (6.0, Build 6001) Service Pack 1 (6001.vistasp1_gdr.080425-1930)
               Language: English (Regional Setting: English)
    System Manufacturer: Acer      
           System Model: Aspire 5315     
                   BIOS: Default System BIOS
              Processor: Intel(R) Celeron(R) CPU          530  @ 1.73GHz, ~1.7GHz
                 Memory: 1014MB RAM
              Page File: 1248MB used, 1036MB available
            Windows Dir: C:\Windows
        DirectX Version: DirectX 10
    DX Setup Parameters: Not found
         DxDiag Version: 6.00.6001.18000 32bit Unicode
    Help?

    EDIT:

    T_T losing hope...
    Last edited by Oyurcopsui; Sep 11th, 2008 at 06:50 PM.

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    6

    Re: [02/03] BIG Problem

    Anyone? Please help :'(!

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: [02/03] BIG Problem

    its not a problem with mscorlib.dll.
    theres an error in your code somewhere thats causing that exception.
    post your full code, and you might get some better answers.

    edit: if there is a problem with your vb2003 installation, reinstalling it is the only option

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    6

    Re: [02/03] BIG Problem

    Code:
    Public Class Form1
        Inherits System.Windows.Forms.Form
    
    #Region " Windows Form Designer generated code "
    
        Public Sub New()
            MyBase.New()
    
            'This call is required by the Windows Form Designer.
            InitializeComponent()
    
            'Add any initialization after the InitializeComponent() call
    
        End Sub
    
        'Form overrides dispose to clean up the component list.
        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If Not (components Is Nothing) Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub
    
        'Required by the Windows Form Designer
        Private components As System.ComponentModel.IContainer
    
        'NOTE: The following procedure is required by the Windows Form Designer
        'It can be modified using the Windows Form Designer.  
        'Do not modify it using the code editor.
        Friend WithEvents Label1 As System.Windows.Forms.Label
        Friend WithEvents shellPic1 As System.Windows.Forms.PictureBox
        Friend WithEvents shellPic2 As System.Windows.Forms.PictureBox
        Friend WithEvents shellPic3 As System.Windows.Forms.PictureBox
        Friend WithEvents shellPictures As System.Windows.Forms.ImageList
        Friend WithEvents Label2 As System.Windows.Forms.Label
        Friend WithEvents cashBox As System.Windows.Forms.TextBox
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
            Me.components = New System.ComponentModel.Container
            Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
            Me.Label1 = New System.Windows.Forms.Label
            Me.shellPic1 = New System.Windows.Forms.PictureBox
            Me.shellPic2 = New System.Windows.Forms.PictureBox
            Me.shellPic3 = New System.Windows.Forms.PictureBox
            Me.shellPictures = New System.Windows.Forms.ImageList(Me.components)
            Me.Label2 = New System.Windows.Forms.Label
            Me.cashBox = New System.Windows.Forms.TextBox
            Me.SuspendLayout()
            '
            'Label1
            '
            Me.Label1.Font = New System.Drawing.Font("Segoe Print", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
            Me.Label1.Location = New System.Drawing.Point(16, 8)
            Me.Label1.Name = "Label1"
            Me.Label1.Size = New System.Drawing.Size(248, 32)
            Me.Label1.TabIndex = 0
            Me.Label1.Text = "Pick a shell and Win!!"
            Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
            '
            'shellPic1
            '
            Me.shellPic1.Location = New System.Drawing.Point(16, 56)
            Me.shellPic1.Name = "shellPic1"
            Me.shellPic1.Size = New System.Drawing.Size(72, 96)
            Me.shellPic1.TabIndex = 1
            Me.shellPic1.TabStop = False
            '
            'shellPic2
            '
            Me.shellPic2.Location = New System.Drawing.Point(104, 56)
            Me.shellPic2.Name = "shellPic2"
            Me.shellPic2.Size = New System.Drawing.Size(72, 96)
            Me.shellPic2.TabIndex = 2
            Me.shellPic2.TabStop = False
            '
            'shellPic3
            '
            Me.shellPic3.Location = New System.Drawing.Point(192, 56)
            Me.shellPic3.Name = "shellPic3"
            Me.shellPic3.Size = New System.Drawing.Size(72, 96)
            Me.shellPic3.TabIndex = 3
            Me.shellPic3.TabStop = False
            '
            'shellPictures
            '
            Me.shellPictures.ImageSize = New System.Drawing.Size(72, 96)
            Me.shellPictures.ImageStream = CType(resources.GetObject("shellPictures.ImageStream"), System.Windows.Forms.ImageListStreamer)
            Me.shellPictures.TransparentColor = System.Drawing.Color.Transparent
            '
            'Label2
            '
            Me.Label2.Location = New System.Drawing.Point(72, 168)
            Me.Label2.Name = "Label2"
            Me.Label2.Size = New System.Drawing.Size(48, 24)
            Me.Label2.TabIndex = 4
            Me.Label2.Text = "Cash"
            Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
            '
            'cashBox
            '
            Me.cashBox.Location = New System.Drawing.Point(128, 168)
            Me.cashBox.Name = "cashBox"
            Me.cashBox.Size = New System.Drawing.Size(56, 20)
            Me.cashBox.TabIndex = 5
            Me.cashBox.Text = "$10"
            '
            'Form1
            '
            Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
            Me.ClientSize = New System.Drawing.Size(280, 229)
            Me.Controls.Add(Me.cashBox)
            Me.Controls.Add(Me.Label2)
            Me.Controls.Add(Me.shellPic3)
            Me.Controls.Add(Me.shellPic2)
            Me.Controls.Add(Me.shellPic1)
            Me.Controls.Add(Me.Label1)
            Me.Name = "Form1"
            Me.Text = "Shell Game"
            Me.ResumeLayout(False)
    
        End Sub
    
    #End Region
        Dim cash As Double = 10
        Dim shell(3) As PictureBox
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            shell(1) = shellPic1
            shell(2) = shellPic2
            shell(3) = shellPic3
    
            Dim currentShell As Double = 1
            For currentShell = 1 To 3
                shell(currentShell).Image() = shellPictures.Images(0)
            Next
    
        End Sub
    
        Function getRandomNumber() As Double
            Return Math.Floor(Rnd() * 3) + 1
        End Function
    
        Private Sub shellPic1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles shellPic1.Click
            checkIfWin(1)
        End Sub
    
        Function checkIfwin(ByVal shellPic As Integer)
            If getRandomNumber() = 1 Then
                won(shellPic)
            Else
                lost(shellPic)
            End If
        End Function
        Function won(ByVal shellpic As Integer)
            cash += 2
            shell(shellpic).Image = shellPictures.Images(1)
            updateCash()
            MessageBox.Show("Congratulations! You won!!")
            shell(shellpic).Image = shellPictures.Images(0)
    
        End Function
        Function lost(ByVal shellpic As Integer)
            cash -= 1
            shell(shellpic).Image = shellPictures.Images(2)
            updateCash()
            MessageBox.Show("Sorry you lost")
            shell(shellpic).Image = shellPictures.Images(0)
            If cash <= 0 Then
                If MessageBox.Show("Play Again?", "Game Over", MessageBoxButtons.YesNo) = DialogResult.Yes Then
                    cash = 10
                    updateCash()
                Else
                    MessageBox.Show("Thanks for Playing", "Game Over")
                    Me.Close()
                End If
            End If
    
        End Function
        Function updateCash()
            cashBox.Text = Format(cash, "c")
        End Function
    
        Private Sub shellPic2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles shellPic2.Click
            checkIfwin(2)
        End Sub
    
        Private Sub shellPic3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles shellPic3.Click
            checkIfwin(3)
        End Sub
    End Class

  6. #6
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: [02/03] BIG Problem

    it probably isn't the problem but you're using functions incorrectly:

    vb Code:
    1. Function checkIfwin(ByVal shellPic As Integer)
    2.     If getRandomNumber() = 1 Then
    3.         won(shellPic)
    4.     Else
    5.         lost(shellPic)
    6.     End If
    7. End Function

    functions return a value, i.e.

    vb Code:
    1. Function checkIfwin(ByVal shellPic As Integer) as boolean
    2.     return true
    3. end function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width