vamsikg

Hi

I am new to .netCF. can any one help me how to handle serial port when PPC is powered off/On.

I am using PocketPCPowermanagement to get the event when the PPC is turned off/On. but i am not able to handle the serial port.

I am trying to SerialPort.Close() , serialPort.Open() but some how these methods are not working. Will any one please help me in fixing the problem. Its very urgent for me to fix.

Thanks in Advance

vamsi.



Re: .NET Compact Framework serial port error on power off/on

sgarc22

How exactly are they not working is it like a compile time error or run time error, or does it just not do what its supposed to




Re: .NET Compact Framework serial port error on power off/on

Bob Schaefer

On a power cycle, the file handle has gone invalid, so the object no longer has valid pointers. The easiest thing to do, is to re-create the port object and then open it. This is what works for me.