Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. a trouble problem about CMSCOMM.OCX

a trouble problem about CMSCOMM.OCX

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Grrrr
    wrote on last edited by
    #1

    :confused::confused::confused: while i try to use atciveX control CMSCOMM.ocx with VC++6.0, i find some trouble problem. 1. must to use 'a &= 0x7F;' because that the code received have a wrong format,but it's right after i use 'a &= 0x7F;'... 2. some code can't be received sometimes. such as: 'thanks', only can receive 'anks' the code as below: void CMainFrame::OnOnCommMscomm() { VARIANT vat_input; COleSafeArray oleSA_input; LONG length, i; BYTE data[1024] = {0}; CString msg; char a = 0; INT nEvent = m_Comm.GetCommEvent(); if (nEvent == 2 ) //|| nEvent == 3 || nEvent == 6) { oleSA_input.Clear(); memset(&vat_input, 0, sizeof(VARIANT)); vat_input = m_Comm.GetInput(); m_Comm.SetInBufferCount(0); oleSA_input = vat_input; length = oleSA_input.GetOneDimSize(); for (i=0; iGetActiveDocument()); if (pDocu->m_CurrentStatus == STATUS_START) { pDocu->DoAnalyseData((LPTSTR)(LPCTSTR)m_strINComstring); } m_strINComstring.Empty(); } else if (nEvent>1000) { if (m_Comm.GetPortOpen()) { m_Comm.SetPortOpen(FALSE); } m_Comm.SetPortOpen(TRUE); } } and the setting as below: m_Comm.SetCommPort(pComSet->ComPort); m_Comm.SetInBufferSize(4096); m_Comm.SetInputMode(1); m_Comm.SetInputLen(0); m_Comm.SetOutBufferSize(4096); m_Comm.SetRThreshold(1); m_Comm.SetSThreshold(0); m_Comm.SetEOFEnable(TRUE); m_Comm.SetDTREnable(TRUE); m_Comm.SetHandshaking(0); m_Comm.SetNullDiscard(FALSE); m_Comm.SetRTSEnable(FALSE); m_Comm.SetSettings(_T("115200, n, 8, 1")); who can helpp me!! thanks!!! :confused::confused:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups