I have created a class that inherits from ListView and a class that inherits ListViewItem and implements IComparable. If I put the items in an ArrayList and Sort the items are sorted correctly, but when i try to use Sort in the ListView it doesnt do anything. I´ve tryied invoking the sort part in the listview but no that doesnt work. I do not want to create a class for the sorting part so i thought that IComparable only on the objects in the collection would allow me not to modify the collection. Is there something im missing???
michael wikstrom
Posts
-
uneable to sort my listview -
connection to server failsI use TCP Client class in the C# client program to connect to the server. I use the accept method in the c-written server to accept the incoming socket connection.
-
connection to server failsI have created a client in C# and a server in C. The Server is run on a linux computer and client on Windows. When the client tries to connect it fails. I have tried modifiyng the server to run on windows, and I am able to establish the connection between two windows computers. It also seems to work connecting a linux version of the client to the server on linux. But it doesn´t work connecting a c# version on windows to the c server on linux.
-
Thread problemI 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); } }
-
DragDrop registration failedI get this error "DragDrop registration failed" when setting the AllowDrop property in a control. Im accessing a control from a different thread than the one that created the control. I use invoke when adding and removing,, the problem is i dont know if i have to invoke the dragdrop event or how it should be done.
-
jumping from one form to anotherI wish to jump from running the main form Form1 to run my Form2. I want my Form2 to dispose Form1 and continue to run as the main form. I have excperienced som difficulty in doing this as when Form1 is disposed it will close Form2 even if i have set the reference in Form1 to acces Form2 to be null. I believe its because Form1 is running the main thread, is it possible for me to create a similar thread in Form2 to overtake the main thread.
-
uneable to update an Access databaseI get an exception in the last line, ExecuteNonQuery. It tells me there is something wrong with the SQL command, although this same command works fine within Access. I have tried this code with insert instead and it works. myConnection = new OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=alfapet.mdb"); myConnection.Open(); using(myConnection) { OleDbCommand com = new OleDbCommand( "UPDATE userinfo SET Password='"+newPass.Pass+"' WHERE Name='"+user.Name+"' AND Password='"+oldPass.Pass+"'", myConnection); int i=com.ExecuteNonQuery();
-
Uneable to stop tcp multithreaded server processI have a problem stopping the server process. Everything seems fine when i stop my multithreaded server, no exceptions when i shut down the application. But the server program wont stop executing. I cant find any more threads that i have forgot to abort. Still if i try to abort the CurrentThread in the end of the program i get an AbortException that cant be handled by the application. Is there something else i can try? Michelangelo