MSComm Control exits with error?
-
I have a question regarding a MSComm Control on a simple dialog form with a thread that exits with an error code 0x1. A new project created with VC++ 6.0 App Wiz, simple dialog, with a MSComm control and a variable mapped to m_Commm and one command button, OpenClose. In 'OnOpenClose' place: m_Comm.SetCommPort(1); m_Comm.SetPortOpen(true); // Doesn't seem to matter whether I // put additional code in here or not. m_Comm.SetPortOpen(false); While using an external analyzer, I can see that the port in question is opening and closing, in fact with additional code I can send and receive data through this port, but always when I close the port the debug window shows a message that the thread has closed with error code 0x1. As near as I can tell this corresponds to ERROR_INVALID_FUNCTION. So my question is; Do I actually have an invalid function, or am I misreading the thread error message?:confused:
-
I have a question regarding a MSComm Control on a simple dialog form with a thread that exits with an error code 0x1. A new project created with VC++ 6.0 App Wiz, simple dialog, with a MSComm control and a variable mapped to m_Commm and one command button, OpenClose. In 'OnOpenClose' place: m_Comm.SetCommPort(1); m_Comm.SetPortOpen(true); // Doesn't seem to matter whether I // put additional code in here or not. m_Comm.SetPortOpen(false); While using an external analyzer, I can see that the port in question is opening and closing, in fact with additional code I can send and receive data through this port, but always when I close the port the debug window shows a message that the thread has closed with error code 0x1. As near as I can tell this corresponds to ERROR_INVALID_FUNCTION. So my question is; Do I actually have an invalid function, or am I misreading the thread error message?:confused:
I have been using MSComm for a while now, and I don't use the .SetPortOpen(FALSE), just let the destructor close it when the application exits. This works fine when I exit the app then sue Hyperterminal etc.. Elaine :rose: The tigress is here :-D
-
I have been using MSComm for a while now, and I don't use the .SetPortOpen(FALSE), just let the destructor close it when the application exits. This works fine when I exit the app then sue Hyperterminal etc.. Elaine :rose: The tigress is here :-D