PDA

View Full Version : accessing serial port without CONFIG += console



bnilsson
21st July 2008, 12:51
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


hComPort = CreateFile( sPortWText,
GENERIC_READ|GENERIC_WRITE,
0,
0,
OPEN_EXISTING,
0,
NULL);

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

jpn
21st July 2008, 19:44
Does it return INVALID_HANDLE_VALUE? What does GetLastError() give?

bnilsson
21st July 2008, 22:47
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?