GetCommState failed with error 87.

Discussion in 'C++' started by uvbaz, Apr 14, 2008.

  1. uvbaz

    uvbaz Guest

    Hi,

    i'm trying to set the serial port.(XP SP2, Visual Studio 2005). I use
    the example code from MSDN "configuring a communications resource".

    CreateFile pass through, however GetCommState return 0.With
    GetLastError(), i get the error number 87, which means
    "ERROR_INVALID_PARAMETER The parameter is incorrect. "
    I'm sure the serial port works, because i can use another program to
    read/write through it.

    thx
    Cheng
     
    uvbaz, Apr 14, 2008
    #1
    1. Advertising

  2. uvbaz

    uvbaz Guest

    On 14 Apr., 16:01, "Victor Bazarov" <> wrote:
    > uvbaz wrote:
    > > i'm trying to set the serial port.(XP SP2, Visual Studio 2005). I use
    > > the example code from MSDN "configuring a communications resource".

    >
    > > CreateFile pass through, however GetCommState return 0.With
    > > GetLastError(), i get the error number 87, which means
    > > "ERROR_INVALID_PARAMETER The parameter is incorrect. "
    > > I'm sure the serial port works, because i can use another program to
    > > read/write through it.

    >
    > Wrong newsgroup. Try 'comp.os.ms-windows.programmer' or the appropriate
    > forum from the 'microsoft.public.*' hierarchy.
    >
    > V
    > --
    > Please remove capital 'A's when replying by e-mail
    > I do not respond to top-posted replies, please don't ask


    O.K.
     
    uvbaz, Apr 14, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sck10
    Replies:
    6
    Views:
    963
    sck10
    Sep 1, 2006
  2. uvbaz

    GetCommState failed with error 87.

    uvbaz, Apr 14, 2008, in forum: C Programming
    Replies:
    6
    Views:
    1,188
    Flash Gordon
    Apr 15, 2008
  3. kiran
    Replies:
    5
    Views:
    3,560
  4. Tony Johansson
    Replies:
    3
    Views:
    16,504
    Patrice
    Jan 2, 2010
  5. Albert-Jan Roskam
    Replies:
    2
    Views:
    108
    Chris Angelico
    Nov 25, 2013
Loading...

Share This Page