SCOMMDlg: protect p_activeDevice if it is NULL

Signed-off-by: fjling <jialingfu@hotmail.com>
Device: add a special code value for last one data

Signed-off-by: fjling <jialingfu@hotmail.com>