Can the serial MSCOMM communication control in the document (SDI / MDI) program in the document (SDI / MDI) program? ◆ Gong Jianwei Technology Home ◆ Gong Jianwei Bear Guangming read the serial debug assistant source program (MSCOMM control) and the detailed programming process, many users asked if the documentation (SDI / MDI) program can be used directly in MScomm directly in the VC Communication control. The answer is no! MSCOMM control (almost all controls) must have a dialog that can be sent. The control icon must be dragged into the dialog from the toolbar, as shown. The icon on the dialog toolbar cannot be dragged into the view (view), and its parasitic is the dialog, so the MSCOMM is inseparable from the dialog box. Some people say that the way is changed, such as making a hidden dialog, that is, the dialog box is not displayed, only the oncomm serial port event handler, unless it is specially handled, otherwise it is not possible. Below is an error experience: I have a serial communication program (SDI), inserting MS Communications Control, Version 6.0 in the project, but assert failure appears when using its method, using debug, the problem is M_PCTRLSITE = FALSE , I am adding to public: cmscomm m_comport in CMYVIEW, then in the message map, but a call method, it is wrong. So how do I use serial communication in SDI / MDI? One method uses API or with some of the more mature classes such as CSerialPort class. If you insist on using the MSComm communication control, you must add some special processing in the oncreate () function in the view. To make an initialization in the dialog box, I will put it as soon as possible. Home. Also, it should be noted that if a view class is derived from the CFormViewo class, it can still use that control because this class has the characteristics of many non-Mode dialogs. There is also a class, and the CRecordView class in the database also depends on a specific dialog template resource based on MDI, or you can use MSCOMM controls. For details, see: Detailed Detailed ODBC Database Technology Application Source Program.
◆ Gong Jianwei technology home page ◆ serial port Tongxun (program source code), serial debugging assistant, port network communication technology, VC / C programming, mobile robot control related technology, MATLAB simulation and data processing