将:
if(m_sp.InitPort(this,port,115200,'N',8,1)){
改为:
if(m_sp.InitPort(this->GetSafeHwnd(),port,115200,'N',8,1)){...
改为:if(m_sp.InitPort((HWND)this,port,115200,'N',8,1)){不行,sendmessage发送接收消息将发送不到本窗口消息内。
将:
if(m_sp.InitPort(this,port,115200,'N',8,1)){
改为:
if(m_sp.InitPort(this->GetSafeHwnd(),port,115200,'N',8,1)){...
改为:if(m_sp.InitPort((HWND)this,port,115200,'N',8,1)){不行,sendmessage发送接收消息将发送不到本窗口消息内。