Results 1 to 8 of 8

Thread: Using WIN32 APi function "GetVolumeNameForVolumeMountPointA"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2011
    Posts
    17
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Using WIN32 APi function "GetVolumeNameForVolumeMountPointA"

    Hi,

    I want to use the win 32 API function GetVolumeNameForVolumeMountPointA in my qt application, but I get this compilation error:
    Qt Code:
    1. error: 'GetVolumeNameForVolumeMountPointA' was not declared in this scope
    To copy to clipboard, switch view to plain text mode 

    WinBase.h and Windows.h are included both. What might be the problem?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using WIN32 APi function "GetVolumeNameForVolumeMountPointA"

    How is this question related to Qt?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2011
    Posts
    17
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Using WIN32 APi function "GetVolumeNameForVolumeMountPointA"

    Sorry, because of the vaque description of my problem.
    I just want to know if it is principally possible to use WIN32 Api functions in Qt applications? Are there any restrictions regarding the used compiler ?

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using WIN32 APi function "GetVolumeNameForVolumeMountPointA"

    Qt application is normal C++ application so You can do this.

  5. #5
    Join Date
    Nov 2011
    Posts
    17
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Using WIN32 APi function "GetVolumeNameForVolumeMountPointA"

    Can I also use it with the gcc compiler, which is available in qtCreator?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using WIN32 APi function "GetVolumeNameForVolumeMountPointA"

    Why wouldn't it be possible? And yes, you can write your code in any code editor you like and you can be wearing a Linux t-shirt while writing Windows code, your Windows shouldn't explode in your face because of that.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Using WIN32 APi function "GetVolumeNameForVolumeMountPointA"

    GetVolumeNameForVolumeMountPointA is defined in winbase.h only on Windows 2003, XP or later. According to the comment in MinGW's windows.h:
    Qt Code:
    1. #ifndef WINVER
    2. #define WINVER 0x0400
    3. /*
    4.  * If you need Win32 API features newer the Win95 and WinNT then you must
    5.  * define WINVER before including windows.h or any other method of including
    6.  * the windef.h header.
    7.  */
    8. #endif
    To copy to clipboard, switch view to plain text mode 
    Values are documented here: http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
    Try:
    Qt Code:
    1. #define WINVER 0x0501
    2. #include <windows.h>
    To copy to clipboard, switch view to plain text mode 
    or put:
    Qt Code:
    1. DEFINES += WINVER=0x0501
    To copy to clipboard, switch view to plain text mode 
    in your PRO file for a project-wide setting
    Last edited by ChrisW67; 4th January 2012 at 00:27.

  8. #8
    Join Date
    Nov 2011
    Posts
    17
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Using WIN32 APi function "GetVolumeNameForVolumeMountPointA"

    Great, it works.

    Thanks a lot.

Similar Threads

  1. Replies: 8
    Last Post: 24th February 2011, 13:22
  2. "unknown test function error" with MAc
    By tommy in forum Installation and Deployment
    Replies: 2
    Last Post: 22nd August 2008, 18:25
  3. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  4. Eclipse "File->New Class" function question
    By MarkoSan in forum General Programming
    Replies: 0
    Last Post: 20th January 2008, 18:22
  5. How do debug "Unhandled Win32 Exception"
    By Doug Broadwell in forum Qt Programming
    Replies: 1
    Last Post: 4th October 2006, 05:17

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
  •  
Qt is a trademark of The Qt Company.