Telefonino.net network
 
| HOMEPAGE | INDICE FORUM | REGOLAMENTO | ::. NEI PREFERITI .:: | RSS Forum | RSS News | NEWS web | NEWS software |
| PUBBLICITA' | | ARTICOLI | WIN XP | VISTA | WIN 7 | REGISTRI | SOFTWARE | MANUALI | RECENSIONI | LINUX | HUMOR | HARDWARE | DOWNLOAD | | CERCA nel FORUM » |

Torna indietro   WinTricks Forum > Software > Programmazione

Notices

Rispondi
 
Strumenti discussione
Vecchio 12-03-2008, 11.18.00   #1
realtebo
Forum supporter
 
L'avatar di realtebo
 
Registrato: 11-07-2003
Messaggi: 1.843
realtebo promette bene
[C#] Evento non lanciato

Ho dichiarato in una mia classe l'evento seguente:

public delegate void EventoSchema(string Schema);

reso esplicito poi da

public event EventoSchema SchemaUpdated;

Nel codice vado a lanciare questo evento scrivendo:

SchemaUpdated ( "bla bla bla");

ma ottengo una eccezione a runtime:

Codice:
System.NullReferenceException was unhandled
  Message="Riferimento a un oggetto non impostato su un'istanza di oggetto."
  Source="GameEngine"
  StackTrace:
       in GameEngine.Partita.ImpostaSequenza(String NuovaMossa) in D:\C# 2008 Projects\IntelliTris 2009\GameEngine\Partita.cs:riga 261
       in GameEngine.Partita.Avvia() in D:\C# 2008 Projects\IntelliTris 2009\GameEngine\Partita.cs:riga 149
       in GameEngine.Partita..ctor(String ilNomeA, String ilNomeB, EnumSimboliGioc ilSimboloA, EnumTipoGioc ilTipoA, EnumTipoGioc ilTipoB, EnumQualeGioc ilPrecedenteVincitore) in D:\C# 2008 Projects\IntelliTris 2009\GameEngine\Partita.cs:riga 130
       in IntelliTris_2009.Principale.mnuNuova_Click(Object sender, EventArgs e) in D:\C# 2008 Projects\IntelliTris 2009\IntelliTris 2009\Principale.cs:riga 46
       in System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
       in System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
       in System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
       in System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
       in System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
       in System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
       in System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
       in System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
       in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       in System.Windows.Forms.Control.WndProc(Message& m)
       in System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       in System.Windows.Forms.ToolStrip.WndProc(Message& m)
       in System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
       in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       in System.Windows.Forms.Application.Run(Form mainForm)
       in IntelliTris_2009.Program.Main() in D:\C# 2008 Projects\IntelliTris 2009\IntelliTris 2009\Program.cs:riga 18
       in System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       in System.Threading.ThreadHelper.ThreadStart()
  InnerException:
Tenete conto che la lunga sequenza di oggetti è dovuta al fatto che questo evento è in un componente che si chiama GameEngine ed una classe Partita,

Inoltre tutto ciò si scatena perchè l'Applicazione principale dal menuItem 'Nuova partita' crea con successo l'istanza della classe, poi la classe fa i suoi ciappini, lancia altri eventi senza problemi, quindi dovrebbe informare con l'evento in questione che lo schema è stato aggiornato.

Però mi da quell'eccezione e non capisco !
___________________________________

Realtebo
realtebo non è collegato   Rispondi citando
Rispondi


Utenti attualmente attivi che stanno leggendo questa discussione: 1 (0 utenti e 1 ospiti)
 
Strumenti discussione

Regole di scrittura
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is ON
Gli smilies sono ON
[IMG] è ON
Il codice HTML è OFF

Vai al forum

Discussioni simili
Discussione Autore discussione Forum Risposte Ultimo messaggio
crash e avvio icone desktop lento ? ropa Windows 7/Vista/XP/ 2003 2 21-12-2007 22.05.17
errori eventi: Asw8ttwdffp + Syrforv0tnu bnvale01 Windows 7/Vista/XP/ 2003 13 18-09-2007 15.53.55
Aiutoo! La partizione Documenti fa i capricci! BlackSkull Windows 7/Vista/XP/ 2003 38 12-06-2007 14.01.19
[XP] errori al avvio del sistema LiNk91 Windows 7/Vista/XP/ 2003 3 30-03-2007 22.17.01
Aiuto: attacco hacker sul mio pc? Shambler Sicurezza&Privacy 16 08-06-2005 01.13.52

Orario GMT +2. Ora sono le: 17.20.28.


E' vietata la riproduzione, anche solo in parte, di contenuti e grafica.
Copyright © 1999-2017 Edizioni Master S.p.A. p.iva: 02105820787 • Tutti i diritti sono riservati
L'editore NON si assume nessuna responsabilità dei contenuti pubblicati sul forum in quanto redatti direttamente dagli utenti.
Questi ultimi sono responsabili dei contenuti da loro riportati nelle discussioni del forum
Powered by vBulletin - 2010 Copyright © Jelsoft Enterprises Limited.