Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Thread problem

Thread problem

Scheduled Pinned Locked Moved C#
graphicshelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michael wikstrom
    wrote on last edited by
    #1

    I seem to be having a problem with threads. I have modified the main function, so that i can run one application first, then when it disposes itself it will jump to the next line in the main function and finally i run the second application. I get errors with window handlers and controls not showing any graphics although i have invoked them. Am i missing something important here? [STAThread] static void Main() { try { Client c = new Client(); GameClient g; Application.Run(c); while(!SHUTDOWN) { if (!SHUTDOWN) { g = new GameClient(c.connection.Socket,c.connection.Username,c.connection.Table,c.connection.Users); Application.Run(g); Thread.Sleep(1000); //c = new Client(); //c = new Client(c.connection.Socket,c.connection.User); //Application.Run(c); SHUTDOWN = true; } } } catch(Exception ex) { MessageBox.Show("Client.Main " + ex.Message); } }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups