I use C #. I create a separate stream and initialize a COM object in it to load data from the network. I can not understand why the form hangs at the time of loading data. I tried to do infinite loops like while and for in the stream, everything goes well with them.

private void button1_Click(object sender, EventArgs e) { Thread thread = new Thread(LoadTP); thread.IsBackground = true; thread.Start(); } public void LoadTP() { MC.Class Test = new MC.Class(); // MC.Class это DLL (COM) написанная на VB5 Test.LoadData(); } 
  • Hm And if in LoadTP only a big Sleep , is it working normally? - VladD
  • I think the problem is that the operation in the new thread loads the CPU at 100%, which causes a hang. - Pavel Azanov
  • BackgroundWorker behaves the same way. I checked the CPU load, it does not exceed 15%. When using Thread.Sleep everything is fine. Is it possible that C # works crookedly with some DLLs? - UltimateOrb

0