Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
C# / VB.NET - Gestire OutOfMemoryException
Forum - C# / VB.NET - Gestire OutOfMemoryException

Avatar
__BlackworM__ (Member)
Pro


Messaggi: 110
Iscritto: 16/08/2008

Segnala al moderatore
Postato alle 11:48
Giovedė, 10/09/2009
Aiuto sto impazzendo !

Ho creato un semplice form di accesso ma quando lo eseguo mi da un errore di memoria insufficiente !


QUESTO IL REPORT:
Codice sorgente - presumibilmente VB.NET

  1. System.OutOfMemoryException non č stata gestita
  2.   Message="Memoria insufficiente."
  3.   Source="System.Drawing"
  4.   StackTrace:
  5.        in System.Drawing.Graphics.FromHdcInternal(IntPtr hdc)
  6.        in System.Windows.Forms.PaintEventArgs.get_Graphics()
  7.        in System.Windows.Forms.Control.PaintBackColor(PaintEventArgs e, Rectangle rectangle, Color backColor)
  8.        in System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset)
  9.        in System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)
  10.        in System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
  11.        in System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e)
  12.        in System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
  13.        in System.Windows.Forms.Control.WmEraseBkgnd(Message& m)
  14.        in System.Windows.Forms.Control.WndProc(Message& m)
  15.        in System.Windows.Forms.ScrollableControl.WndProc(Message& m)
  16.        in System.Windows.Forms.ContainerControl.WndProc(Message& m)
  17.        in System.Windows.Forms.Form.WndProc(Message& m)
  18.        in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  19.        in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  20.        in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  21.        in System.Windows.Forms.UnsafeNativeMethods.PeekMessage(MSG& msg, HandleRef hwnd, Int32 msgMin, Int32 msgMax, Int32 remove)
  22.        in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
  23.        in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
  24.        in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
  25.        in System.Windows.Forms.Application.Run(ApplicationContext context)
  26.        in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
  27.        in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
  28.        in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
  29.        in GFS_Communication_Generale.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:riga 81
  30.        in System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
  31.        in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
  32.        in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
  33.        in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
  34.        in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  35.        in System.Threading.ThreadHelper.ThreadStart()
  36.   InnerException:



questo e' il codice del form molto molto semplice ma va ad aprire altri form leggermente pių complessi...

come risolvo ? :hail:
oppure se dovrei liberare memoria al caricamento ?

Codice sorgente - presumibilmente VB.NET

  1. Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
  2.  
  3.         'Se č un agente
  4.         If txtUser.Text = "agente" And txtPass.Text = "agente" Then
  5.             Me.Hide()
  6.             frmAgenti.ShowDialog()
  7.             Me.Close()
  8.  
  9.             'Se č un addetto al call center
  10.         ElseIf txtUser.Text = "callcenter" And txtPass.Text = "callcenter" Then
  11.             Me.Hide()
  12.             frmTelemarketing.ShowDialog()
  13.             Me.Close()
  14.  
  15.             ' Se č l'amministratore
  16.         ElseIf txtUser.Text = "admin" And txtPass.Text = "admin" Then
  17.             Me.Hide()
  18.             frmAdmin.ShowDialog()
  19.             Me.Close()
  20.  
  21.         Else
  22.             'Login errato
  23.             MsgBox("Attenzione Username o Password Errati !", MsgBoxStyle.Exclamation)
  24.             Exit Sub
  25.         End If
  26.     End Sub
  27.  
  28.     Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
  29.         Me.Close()
  30.     End Sub


PM Quote
Avatar
Il Totem (Admin)
Guru^2


Messaggi: 3635
Iscritto: 24/01/2006

Segnala al moderatore
Postato alle 13:32
Venerdė, 11/09/2009
Manca il resto del codice. Usi immagini particolarmente pesanti, magari su un dispositivo mobile?

PM Quote
Avatar
__BlackworM__ (Member)
Pro


Messaggi: 110
Iscritto: 16/08/2008

Segnala al moderatore
Postato alle 15:41
Venerdė, 11/09/2009
Grazie come al solito Totem, comunque ho risolto riavviando il mio pc, anche se le immagini sono leggere ed il mio pc č molto molto potente, quindi in ogni caso non ho capito a cosa e dovuto...

PM Quote