Answer the question
In order to leave comments, you need to log in
Is it possible to obtain a HANDLE with QSerialPort similar to the HANDLE obtained with CreateFile(winapi, )?
Is it possible to get a HANDLE using QSerialPort similar to the HANDLE obtained using CreateFile (winapi, windows.h)?
There is a code written in C ++ and WinApi, in which the port is opened to access the device with:
LPTSTR port_name = TEXT("COM5");
HANDLE hCom = CreateFile((LPCWSTR)port_name,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0,
NULL);
HANDLE hCom;
QSerialPort *serial;
serial = new QSerialPort();
serial->setPortName("COM5");
serial->setBaudRate(QSerialPort::Baud38400);
serial->open(QIODevice::ReadWrite);
hCom = serial->handle();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question