Results 1 to 3 of 3

Thread: accessing serial port without CONFIG += console

  1. #1
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default accessing serial port without CONFIG += console

    I am trying to access a Windows serial port, and it works if I have CONFIG += console in the .pro file, but not without this switch.
    Since I do not want the console window in my final app, this is a problem.
    What could be the reason?

    I am using

    Qt Code:
    1. hComPort = CreateFile( sPortWText,
    2. GENERIC_READ|GENERIC_WRITE,
    3. 0,
    4. 0,
    5. OPEN_EXISTING,
    6. 0,
    7. NULL);
    To copy to clipboard, switch view to plain text mode 
    an exaple snip form the code.
    I am not using any references to QIODevice in the serial port code.
    I am porting some (working) code from another context in to a Qt app, and I have left the serial port part untouched.
    It compiles and runs in my Qt app, but I only get working I/O if I have CONFIG += console.

    BN
    Last edited by bnilsson; 21st July 2008 at 16:48.
    MacOSX user dabbling with Linux and Windows.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: accessing serial port without CONFIG += console

    Does it return INVALID_HANDLE_VALUE? What does GetLastError() give?
    J-P Nurmi

  3. #3
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: accessing serial port without CONFIG += console

    Right now I am gathering resources to be able to debug in Windows.

    I am normally using Xcode to develop and debug on MacOSX, and then plain build for Windows.
    Which obviously is not enough in this case.

    Suggest a good IDE, anyone?
    MacOSX user dabbling with Linux and Windows.

Similar Threads

  1. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.