This is new to me. I been playing a round with some libraries for an FTP server. It's just that the person who made it is from Japan.
Any way I keep getting a,
Cross Thread operation not valid control 'm_ListBoxMessages' accessed from a thread other then the thread it was created on.
Well i check google.com again and found some fixes. It just I don't under stand what to do or how to do it.
Here the code that calls it
and here the code it calls.Code:Assemblies.Ftp.FtpServerMessageHandler.Message += new Assemblies.Ftp.FtpServerMessageHandler.MessageEventHandler(MessageHandler_Message);
can some one please tell me how to fix this. This is all new to me. This kind of programing is too complexed for me.Code:private void MessageHandler_Message(int nId, string sMessage) { m_listBoxMessages.BeginUpdate(); int nItem = m_listBoxMessages.Items.Add(string.Format("({0}) <{1}> {2}", nId, System.DateTime.Now, sMessage)); if (m_listBoxMessages.Items.Count > 5000) { m_listBoxMessages.Items.RemoveAt(0); } if (m_listBoxMessages.SelectedIndex < 0) { m_listBoxMessages.TopIndex = nItem; } else if (m_listBoxMessages.SelectedIndex == nItem - 1) { m_listBoxMessages.SelectedIndex = nItem; } m_listBoxMessages.EndUpdate(); }
Thanks
Joe




Reply With Quote