i have music resources and it seems i keep getting system.outofmemory exception. here is my code, and if you could figure out why exactly im getting this exception. im thinking it has to do with my music resources, and i checked the songs they work fine.
Public
Class WWE Friend WithEvents mediasoundplayer As New System.Media.SoundPlayer Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChangedComboBox2.Show()
End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim answer As MsgBoxResultanswer = MsgBox(
"Are you sure you want to exit ", MsgBoxStyle.YesNo) If answer = MsgBoxResult.Yes Then End End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try Select Case ComboBox1.SelectedItem Case Is = ComboBox1.TextMessageBox.Show(
"Your favorite show: " & ComboBox1.Text()) End Select Select Case ComboBox2.SelectedItem Case Is = ComboBox2.TextMessageBox.Show(
"Your favorite superstar: " & ComboBox2.Text()) End Select Catch ex As ExceptionMessageBox.Show(
"You did not select a show or superstar.", "Selecting Problem", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub Private Sub WWE_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loadmediasoundplayer.Stream =
My.Resources.Three_Days_Grace___Riotmediasoundplayer.PlayLooping()
Dim wwesite As String = "http://www.wwe.com" Me.LinkLabel1.Links.Add(0, wwesite.Length, wwesite) Me.LinkLabel1.Text = "WWE SITE" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles aboutbutton.ClickHide()
AboutBox1.Show()
End Sub Private Sub TextBox1_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged If My.Computer.FileSystem.FileExists(TextBox1.Text) ThenMsgBox(
"File Found") ElseMsgBox(
"File not Found") End If End Sub Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged Try Select Case ListBox1.SelectedItem Case Is = "Static X - Start A War"mediasoundplayer.Stream =
My.Resources.Static_X___Start_A_Warmediasoundplayer.PlayLooping()
End Select Catch ex As System.OutOfMemoryExceptionMessageBox.Show(
"You dont have enough memory to run this program.", "Memory Problem", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClickede.Link.Visited =
TrueSystem.Diagnostics.Process.Start(e.Link.LinkData.ToString())
End SubEnd
Class
system.outofmemory exception, music problem
Dagz
mcgin1591,
How is your project going There is an article contains prooject example on Using CopyMemory in .NET of the code project website and I hope it will help you to solve your public sharing problem with your friends. The link is as folllows:
http://www.codeproject.com/vb/net/netcopymemorysample.asp
doctorx0079
tattoo
Jonas Beckeman