PDA

View Full Version : Using Winapi in Qt?



Awareness
21st February 2010, 02:55
Is it possible to use Winapi in Qt?I found some Winapi examples on internet,then I chose "empty Qt4 project" in Qt Creator,then I added a source file,and then copied and pasted the example code into the source file(.cpp).But Qt Creator gave many errors when I try to build it.I tried with other example Winapi codes too,but again it gave many errors...

Awareness
21st February 2010, 03:22
I tried a few other examples,and they worked.But I didn't use Wiapi code in Qt application,it worked as a seperate standard c++ file.How can I use Winapi in Qt applications(both Qt and Winapi code in the same file) ,is it possible??

Also I wonder why I couldn't find proper information about using winapi with Qt on internet.

squidge
21st February 2010, 10:38
Just include the appropriate windows header file and libraries, and it'll work as expected. For example, a lot of WinAPI functions can be defined by simply including windows.h

JovianGhost
23rd March 2010, 04:04
Also don't forget to include the proper libraries during linking.