o = CreateObject("CommHandler") result = o.Open(thisform.mscomm) If result <> 0 MessageBox("Error " + Transform(result) + " attempting to open comm port") EndIf *-------------------------------- Define Class CommHandler as Line ErrValue = 0 Procedure Open( loComm) loComm.portopen = .t. Return this.ErrValue EndProc Procedure Error( nError, cMethod, nLine) this.ErrValue = nError Return EndProc EnddefineHope this helps