太阳上乘凉 2016-07-08 02:53 采纳率: 0%
浏览 937

vc++6.0 串口编译链接通过之后,运行出错。

vc++6.0 CSerialPort类实现串口编程,编译链接通过后,运行出错,如下。大神帮帮忙!

出错信息

Microsoft Visual C++ Runtime Library

Assertion failed!

Program: ...c++6.0\SerialPortTest\Debug\SerialPortTest.exe
File: C:\Users\zy\Documents\vc++6.0\SerialPortTes...
Line: 112

Expression: portnr > 0 && portnr < 200

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)

中止(A) 重试(R) 忽略(I)

图片说明

  • 写回答

2条回答

  • oyljerry 2016-07-08 05:43
    关注

    你的portnr值不在合法范围内

    评论

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题