Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i worked on Windows application(Winforms) for SMS Project using Modem. that modem working fine on Windows-7 32 bit OS. But it's not working on 64 bit every time i get exception(COM is already used by some other process)
but same application worked on 32 bit working fine.
what is the problem?

Code from OP:
C#
GsmCommMain comm = new GsmCommMain(port, baudRate, timeout); 
try 
{ 
     if (comStatus) 
     { 
     comm.Open(); // here i got exception (Com 5 Already used by some other process) 
     comStatus = false;
     Thread.Sleep(20000); 
    
     if (!comm.IsConnected()) 
     { //AddToLog("Not Connected : Port - " + port);
         comm.Close(); 
         //return false;
     } 
     else 
     { 
          if (comMTN) 
          { 
          comm.Close();
          comMTN = false;
          comPortNonMTN = i; 
          i = strport.Length + 1; 
          count = 1; 
          AddToLog("Connected: Port - " + port); 
          return true; 
          } 
          else 
          { 
          AddToLog("Connected: Port - " + port); 
          comm.Close(); 
          return true; 
          } 
    } 
} 
} 
catch (Exception ex) 
{ //return}


here i used Beetel and I-ball and MTN modems..
Posted
Updated 16-Aug-12 18:51pm
v3
Comments
Kenneth Haugland 16-Aug-12 23:47pm    
Did you change the enviroment to build the application in?
Kuthuparakkal 16-Aug-12 23:51pm    
can you oust the code that creates exception
sai sagar 16-Aug-12 23:54pm    
when i connecting at Port number i get exception.
Kenneth Haugland 17-Aug-12 0:03am    
I pretty sure he means that: could you post the error message with the code that cused it?
sai sagar 17-Aug-12 0:27am    
Code given: see revised question

1 solution

You would need to check witch device that is holding the connection closed while you are trying to access it. You can find that out, take a look here:
http://support.microsoft.com/kb/817900[^]

This is for USB connected devices, but the same approch should give you information on what program that uses your com port also. OIther links that might be useful for you:
http://obbig.wordpress.com/a-short-hyperterminal-tutorial/[^]

http://www.developershome.com/sms/howToUseHyperTerminal.asp[^]
 
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