c++ - Win 32 API in Qt -
I have a program using MFC to communicate with Ethernet on a device. I have to type it again and it should be converted to QT
The MFC program uses Win API functions such as CreateFile, ReadFile (to get network packets) and DeviceIOControl (the protocol used to facilitate communication To talk)
Can I use these functions - CreateFile, ReadFile and DeviceIOControl directly in my QT code if I include Windows.h?
How about Win API functions used for concurrency, such as WaitForSingleObject and Mutex? What part of Win API / Q is not available in Q?
Is there a standard mechanism for converting MFC code to Qt?
Can I use these functions - CreateFile, ReadFile and my DeviceIOControl directly if I include Windows.h?
Yes.
How about using Win API functions for transition, such as WaitForSingleObject and Mutex? Which part of the Win API is not available in QT?
You can use any part of Win API.
Is there any standard mechanism to convert the MFC code to QT
is not a standard system, however, for the above functionality, you actually have the Qt option , Such as QMutex, etc.
In addition, you have to consider whether the conversion is worth it or not. After all, Qt Windows will use Windows API in the background.
Let's say that you want to make your code cross-platform, you actually want to migrate directly with the use of Windows API, otherwise your code will be filled with preprocessor instructions at compile time.
Comments
Post a Comment