Note that there are some explanatory texts on larger screens.

plurals
  1. POUSe function from user32.dll in Qt4 application
    text
    copied!<p>i am unable to use the function MonitorFromPoint in my Qt application. I have the latest Qt SDL 2010.05 with mingw on Windows XP</p> <pre><code>#include &lt;QtCore/QCoreApplication&gt; #include&lt;windows.h&gt; #include &lt;winuser.h&gt; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); POINT pt; MonitorFromPoint(pt,2); return a.exec(); } </code></pre> <p>I added this to the .pro file</p> <pre><code>LIBS+= -luser32 </code></pre> <p>And the result is</p> <pre><code>g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\include\QtCore" -I"..\include" -I"..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\testUser32" -I"." -I"..\mkspecs\win32-g++" -o tmp\obj\debug_shared\main.o ..\testUser32\main.cpp mingw32-make[1]: Leaving directory `C:/Qt/2010.05/qt/testUser32-build-desktop' mingw32-make: Leaving directory `C:/Qt/2010.05/qt/testUser32-build-desktop' ..\testUser32\main.cpp: In function 'int main(int, char**)': ..\testUser32\main.cpp:8: error: 'MonitorFromPoint' was not declared in this scope mingw32-make[1]: *** [tmp/obj/debug_shared/main.o] Error 1 mingw32-make: *** [debug-all] Error 2 The process "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" exited with code %2. Error while building project testUser32 (target: Desktop) When executing build step 'Make' </code></pre> <p>Someone on the IRc said that is a mingw prolem and i should use visualc compiler. Switching the compiler will take time and maybe i will findother problems. I imported functions from wingdi.h and i had no problems. I need a better explanation about the problem, how you figure it out and the solution</p> <p>P.S. I am trying to get the screen geometryes in a multi monitor system, QDesktopWidget does not work ,see the topic <a href="https://stackoverflow.com/questions/3966429/capture-multiple-screens-desktop-image-using-qt4">Capture multiple screens desktop image using Qt4</a> </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload