Click here to Skip to main content
15,910,872 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi I have a program that sends sms with kylix component. it works nice but Immediately it hangs.
i'm using this code for send sms:


C#
Thread s = new Thread(new ThreadStart(send));
            s.Start();
            Thread.Sleep(1000);
            s.Abort();

public void send()
        {
          long ls=  axKylixSMS.SendSMS(mynum, mytext);
           if(ls < 1) 
             MessageBox.Show("your message has not been sent");
            else
             MessageBox.Show("your message has been sent");
        }

how can i prevent from freeze the program when i send sms with kylix?
please help me!
thanks in advance

What I have tried:

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Posted
Updated 8-Jul-16 17:14pm
Comments
Gautham Prabhu K 5-Jul-16 5:53am    
Is there an Asych version for the SendSMS API?
Philippe Mori 5-Jul-16 12:04pm    
This code does not make much sense. You don't abort the thread. Read books on multithreading and only once you understand it a bit, then write some code.
Madhu Nair 7-Jul-16 3:10am    
try running the code removing thread.abort and thread.sleep

1 solution

It hangs because you told it to when you told it to sleep for a second. If it hangs when you call axKylixSMS then contact the vendor of that component for ways to troubleshoot.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900