abhi.nalluri 0 Newbie Poster

Hi All,

I have an application to open a serial port and write commands to it.

I have used CreateFile function along with ReadFile and WriteFile.
I need to use my serial connection from Network Connections and connect to a device.After connecting to the device I disconnect it.
Now I restart my application but It is not able to communicate with the device.After using my serial port connection my hyperterminal works but my application hangs when I issue WriteFile.

Can anybody help me out of this.Is there anything that I have to handle.

handle = CreateFile(PORT_NO,
		                    GENERIC_READ | GENERIC_WRITE, 
			                0, 
			                NULL, 
			                OPEN_EXISTING, 
			                FILE_FLAG_WRITE_THROUGH,
		       	            NULL);

I am opening the handle at the beginning of the program.
Later in the rest I use WriteFile and ReadFile as required.
It works fine util there are some operations from serialport in the network Interfaces.
What would be causing this.