Sign in to follow this  

problem change screen xna

Recommended Posts

the problem is execute the game and make the login if the StateManager.PushState(GameRef.StartMenuScreen); in the function private void ProcessComplete(Headers header, ErrorCodes Erro)

give a message of server is offline

i put my interecode in github

this is the link to my code

Edited by Landi20

Share this post

Link to post
Share on other sites

Sounds more like a hack to make it work, since the setting name suggests cross-thread calls are actually illegal. If you have time you should check your code to make sure you're not accessing the GUI from multiple threads, before your code becomes too big to fix - this kind of concurrency issue is sure to come bite you again later on (this warning is actually there to alert you of it, since they can be hard to detect and track down).

Share this post

Link to post
Share on other sites

thanks for advice but this is a tempory fix

what you sujest to fix my problem

how i fix the problem not using this code System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;

this is my issos when i dont use System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;

A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
'TomShane.Neoforce.Central.exe' (CLR v4.0.30319: TomShane.Neoforce.Central.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_pt_b77a5c561934e089\mscorlib.resources.dll'. Module was built without symbols.
ERROSystem.InvalidOperationException: A operação entre threads não é válida: controlo 'GameForm' acedido a partir de um thread diferente do thread onde foi criado.
   em System.Windows.Forms.Control.get_Handle()
   em System.Windows.Forms.Control.set_Cursor(Cursor value)
   em TomShane.Neoforce.Controls.Manager.SetCursor(Cursor cursor)
   em TomShane.Neoforce.Controls.Manager.SetSkin(Skin skin)
   em TomShane.Neoforce.Controls.Manager.SetSkin(String name)
   em TomShane.Neoforce.Controls.Manager.Initialize()
   em TomShane.Neoforce.Central.Code.server.Initialize() em c:\Users\Pedro\Dropbox\GAMES\TomShane.Neoforce.Controls.XNA4\Neoforce\Source\Central\Code\server.cs:line 283
   em Microsoft.Xna.Framework.Game.GameComponentAdded(Object sender, GameComponentCollectionEventArgs e)
   em Microsoft.Xna.Framework.GameComponentCollection.OnComponentAdded(GameComponentCollectionEventArgs eventArgs)
   em Microsoft.Xna.Framework.GameComponentCollection.InsertItem(Int32 index, IGameComponent item)
   em System.Collections.ObjectModel.Collection`1.Add(T item)
   em XRpgLibrary.GameStateManager.AddState(GameState newState) em c:\Users\Pedro\Dropbox\GAMES\TomShane.Neoforce.Controls.XNA4\Neoforce\Source\XRpgLibrary\GameStateManager.cs:line 81
   em XRpgLibrary.GameStateManager.PushState(GameState newState) em c:\Users\Pedro\Dropbox\GAMES\TomShane.Neoforce.Controls.XNA4\Neoforce\Source\XRpgLibrary\GameStateManager.cs:line 74
   em TomShane.Neoforce.Central.Code.TitleScreen.ProcessComplete(Headers header, ErrorCodes Erro) em c:\Users\Pedro\Dropbox\GAMES\TomShane.Neoforce.Controls.XNA4\Neoforce\Source\Central\Code\TitleScreen.cs:line 249
   em TomShane.Neoforce.Central.Code.LoginClient.process(Object o) em c:\Users\Pedro\Dropbox\GAMES\TomShane.Neoforce.Controls.XNA4\Neoforce\Source\Central\Code\LoginClient.cs:line 57

Edited by Landi20

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this