[HELP] setting buffer lenght in MSCOMM
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: [HELP] setting buffer lenght in MSCOMM

  1. #1
    Join Date
    Sep 2011
    Posts
    4

    [HELP] setting buffer lenght in MSCOMM

    Hi,I have a program to read data using Microsoft Communication Control(MSCOMM). I want to set the buffer input length of 1 byte. but it can't run.
    this is my program :
    Code:
    	m_comm.SetCommPort(12);
    	m_comm.SetSettings("9600,N,8,1");
    	m_comm.SetInputLen(1); // read 1 byte data
    	m_comm.SetRTSEnable(FALSE);
    	m_comm.SetRThreshold(0);
    	m_comm.SetInBufferSize(1); // setting input buffer lenght
    	m_comm.SetPortOpen(true);
    Do you have a solution?

  2. #2
    Join Date
    Feb 2002
    Posts
    4,640

    Re: [HELP] setting buffer lenght in MSCOMM

    Define "can't run".

    Viggy

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,011

    Re: [HELP] setting buffer lenght in MSCOMM

    Quote Originally Posted by azhari24 View Post
    Hi,I have a program to read data using Microsoft Communication Control(MSCOMM). I want to set the buffer input length of 1 byte. but it can't run...

    Do you have a solution?
    Yes, I do.
    Just get rid of MSCOMM. Use Windows APIs (or better, some free MFC classes like in http://www.flounder.com/serial.htm) instead.
    Victor Nijegorodov

  4. #4
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: [HELP] setting buffer lenght in MSCOMM

    In addition to Victors post, here's another class you can use for comm communication.

  5. #5
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,553

    Re: [HELP] setting buffer lenght in MSCOMM

    And here is another one, CSerialPort from PJ Naughter: http://www.naughter.com/serialport.html

    Mike

  6. #6
    Join Date
    Sep 2011
    Posts
    4

    Re: [HELP] setting buffer lenght in MSCOMM

    Quote Originally Posted by MrViggy View Post
    Define "can't run".

    Viggy
    okey, I will try...

  7. #7
    Join Date
    Sep 2011
    Posts
    4

    Re: [HELP] setting buffer lenght in MSCOMM

    Quote Originally Posted by VictorN View Post
    Yes, I do.
    Just get rid of MSCOMM. Use Windows APIs (or better, some free MFC classes like in http://www.flounder.com/serial.htm) instead.
    okey. thank your answer...

  8. #8
    Join Date
    Sep 2011
    Posts
    4

    Re: [HELP] setting buffer lenght in MSCOMM

    Quote Originally Posted by MikeAThon View Post
    And here is another one, CSerialPort from PJ Naughter: http://www.naughter.com/serialport.html

    Mike
    okey, thanks, do you sample porgram?

  9. #9
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,553

    Re: [HELP] setting buffer lenght in MSCOMM

    Quote Originally Posted by azhari24 View Post
    okey, thanks, do you sample porgram?
    At the site I linked to (i.e., at http://www.naughter.com/serialport.html ). Did you even bother to look at it?
    Quote Originally Posted by PJ Naughter's site
    The enclosed zip file contains the CSerialPort source code and a simple test program which exercises all class API's.
    Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center