It's not a static method, that's one thing. The other is that it will convert the string to std::wstring, just as the name of the method says and not to a char*. The device name probably contains ascii characters only anyway, so you can probably do this:
QString device
= "<something goes here">;
QString adjustDeviceStr
= "\\\\.\\"+device;
HComm = CreateFile(ba.constData(), ...);
QString device = "<something goes here">;
QString adjustDeviceStr = "\\\\.\\"+device;
QByteArray ba = adjustDeviceStr.toAscii();
HComm = CreateFile(ba.constData(), ...);
To copy to clipboard, switch view to plain text mode
Bookmarks