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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. sorry for distrubing

sorry for distrubing

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpannouncement
3 Posts 3 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.
  • K Offline
    K Offline
    krishna Vuppala
    wrote on last edited by
    #1

    Sorry for distrubing all. i have to create communication Between modem and Pc through RS-232. 1)i created a port along with activeX(microsoft Communication control, version 6.0)control.it works well and opened the serial port. 2)my dialoge box is having all port configaration controls(like hyperterminal) and after that two edit boxes one for commands to modem,after that submit button. next there will edit box for responces for Modem. 3)iam not able to create thread for communication b/w pc and modem. which fuctions i have to call.pls anybody help 4)iam successfully completed the communication B/w two sys by RS-232 port. here is the thread where i used in Communication b/w in two sys UINT ReaderThread(LPVOID lParam) { CString strCount; VARIANT vtResult; CString str,str1; CSerialcomDlg* m_wnd = (CSerialcomDlg*)lParam; while(1) { int nCount = m_wnd->m_CommControl.GetInBufferCount(); if(nCount > 0) { strCount.Format("%d",nCount); for(int i = 0; i< nCount;i++) { vtResult = m_wnd->m_CommControl.GetInput(); str.Format("%s",(LPCSTR)(_bstr_t)vtResult); str1 = str; } m_wnd->m_edtrecvdata.SetWindowText(str1); } } return TRUE; }

    G R 2 Replies Last reply
    0
    • K krishna Vuppala

      Sorry for distrubing all. i have to create communication Between modem and Pc through RS-232. 1)i created a port along with activeX(microsoft Communication control, version 6.0)control.it works well and opened the serial port. 2)my dialoge box is having all port configaration controls(like hyperterminal) and after that two edit boxes one for commands to modem,after that submit button. next there will edit box for responces for Modem. 3)iam not able to create thread for communication b/w pc and modem. which fuctions i have to call.pls anybody help 4)iam successfully completed the communication B/w two sys by RS-232 port. here is the thread where i used in Communication b/w in two sys UINT ReaderThread(LPVOID lParam) { CString strCount; VARIANT vtResult; CString str,str1; CSerialcomDlg* m_wnd = (CSerialcomDlg*)lParam; while(1) { int nCount = m_wnd->m_CommControl.GetInBufferCount(); if(nCount > 0) { strCount.Format("%d",nCount); for(int i = 0; i< nCount;i++) { vtResult = m_wnd->m_CommControl.GetInput(); str.Format("%s",(LPCSTR)(_bstr_t)vtResult); str1 = str; } m_wnd->m_edtrecvdata.SetWindowText(str1); } } return TRUE; }

      G Offline
      G Offline
      Gary R Wheeler
      wrote on last edited by
      #2

      I suggest using the search[^] page here on Code Project, and enter 'serial' as the keyword.


      Software Zen: delete this;

      Fold With Us![^]

      1 Reply Last reply
      0
      • K krishna Vuppala

        Sorry for distrubing all. i have to create communication Between modem and Pc through RS-232. 1)i created a port along with activeX(microsoft Communication control, version 6.0)control.it works well and opened the serial port. 2)my dialoge box is having all port configaration controls(like hyperterminal) and after that two edit boxes one for commands to modem,after that submit button. next there will edit box for responces for Modem. 3)iam not able to create thread for communication b/w pc and modem. which fuctions i have to call.pls anybody help 4)iam successfully completed the communication B/w two sys by RS-232 port. here is the thread where i used in Communication b/w in two sys UINT ReaderThread(LPVOID lParam) { CString strCount; VARIANT vtResult; CString str,str1; CSerialcomDlg* m_wnd = (CSerialcomDlg*)lParam; while(1) { int nCount = m_wnd->m_CommControl.GetInBufferCount(); if(nCount > 0) { strCount.Format("%d",nCount); for(int i = 0; i< nCount;i++) { vtResult = m_wnd->m_CommControl.GetInput(); str.Format("%s",(LPCSTR)(_bstr_t)vtResult); str1 = str; } m_wnd->m_edtrecvdata.SetWindowText(str1); } } return TRUE; }

        R Offline
        R Offline
        Roger Stoltz
        wrote on last edited by
        #3

        krishna Vuppala wrote:

        3)iam not able to create thread for communication b/w pc and modem. which fuctions i have to call.

        To get started with multithreading and avoid common pitfalls, read this[^]. In my opinion the very best starting point for multithreading. When you've read the article above and understood it, you'll face a new problem: since you're using an ActiveX control and want to access it from different threads, you need to know how to cross apartment boundaries the right way using marshalling. Read Lim Bio Liong's excellent article series starting here[^]. Writing the serial communication part by yourself, not using the MSComm control, isn't that hard really. Have a look at Joe Newcomer's article here[^].


        "It's supposed to be hard, otherwise anybody could do it!" - selfquote
        "High speed never compensates for wrong direction!" - unknown

        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