Results 1 to 3 of 3

Thread: problems including platform SDK headers

  1. #1
    Join Date
    Dec 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default problems including platform SDK headers

    Hi,
    I don't like the results I'm getting with QProcess, so I would like to do a sanity check of my parameters to make sure they still work with the WIN32 code I am porting. I tried including <shellapi.h> and also <windows.h> with no success, trying to use the ShellExecute function. I am seeing many compile errors because of missing type definitions.

    How can I setup the build environment so that I can include platform SDKs?

    I'm developing in Creator (and loving it). Customizing the build has been difficult for me. Any tips are much appreciated?

    John

  2. #2
    Join Date
    Oct 2008
    Posts
    71
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: problems including platform SDK headers

    try including "QtCore/qt_windows.h" - it should include all necessary headers and defines. After which include your <shellapi.h> (<windows.h> is already included by at_windows.h)

  3. #3
    Join Date
    Dec 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: problems including platform SDK headers

    I guess using platform headers does work out of the box. I realized the compile error came from the example code I pasted from MSDN using ShellExecute. I removed everything but the use of ShellExecute, included <windows.h>, and had no compile errors. I still needed to link to the windows shell library, and I figured out how to do that from the .pro file, LIBS += shell32.lib.

    Thanks for the suggestion. I don't understand the reason for the Qt platform headers, I suspect they are for internal use. I was expecting an answer like "put CONFIG += windows in your .pro file".

    Another tip, I'm using DEFINES+=UNICODE in my .pro file to get use of Unicode versions of platform code. For example, now I can feed QString (converted to stdW string) right into the arguments of ShellExecuteW.

Similar Threads

  1. including Qt headers in DLL
    By dave_mm0 in forum Newbie
    Replies: 7
    Last Post: 15th July 2009, 21:39
  2. Replies: 5
    Last Post: 19th November 2008, 17:54
  3. Including headers path
    By !Ci in forum Qt Programming
    Replies: 7
    Last Post: 5th August 2008, 18:00
  4. Weird Cross Platform Printing Problems
    By igor in forum Qt Programming
    Replies: 7
    Last Post: 7th August 2007, 16:25
  5. Replies: 2
    Last Post: 8th March 2007, 22:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.