943,793 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 2151
  • C++ RSS
Feb 5th, 2008
0

need help in using FindFirstVolume() API

Expand Post »
i wrote a code to get hard disk info and used FindFirstVolume(). however, the console-based application was ok but when i made an MFC application doing the same thing, it did not compile correctly. i think the problem is with my redeclaration of _WIN32_WINNT in the MFC application. this is because there are header files in the MFC application that already assigns the value of _WIN32_WINNT and i can't seem to find all of the header files that do this.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jov0708 is offline Offline
6 posts
since Feb 2008
Feb 5th, 2008
0

Re: need help in using FindFirstVolume() API

Click to Expand / Collapse  Quote originally posted by jov0708 ...
iit did not compile correctly..
What does the compiler say? What errors are there? I've just tried using FindFirstVolumeW in a MFC-app, but it works fine for me.
Last edited by Nick Evan; Jan 23rd, 2011 at 3:48 pm.
Moderator
Featured Poster
Reputation Points: 4142
Solved Threads: 394
Industrious Poster
Nick Evan is online now Online
4,132 posts
since Oct 2006
Feb 5th, 2008
0

Re: need help in using FindFirstVolume() API

What is the error? You can always redifine _WIN32_WINNT as per your target OS
Reputation Points: 39
Solved Threads: 24
Junior Poster
dubeyprateek is offline Offline
176 posts
since Mar 2006
Feb 5th, 2008
0

Re: need help in using FindFirstVolume() API

Click to Expand / Collapse  Quote originally posted by niek_e ...
What does the compiler say? What errors are there? I've just tried using FindFirstVolumeW in a MFC-app, but it works fine for me.

Niek
ohh... anyway, i defined _WIN32_WINNT in my code but there is an error that says "_WIN32_WINNT: macro redefinition" and i can't find the file that redefines this macro.

thanks for your help in advance.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jov0708 is offline Offline
6 posts
since Feb 2008
Feb 6th, 2008
0

Re: need help in using FindFirstVolume() API

Quote ...
What does the compiler say? What errors are there? I've just tried using FindFirstVolumeW in a MFC-app, but it works fine for me.
nick,

what definitions and header files did you include? i encounter this error "FindFirstVolume: identifier not found..." in my MFC app.

jov
Last edited by Nick Evan; Jan 23rd, 2011 at 3:49 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jov0708 is offline Offline
6 posts
since Feb 2008
Feb 6th, 2008
0

Re: need help in using FindFirstVolume() API

I looked here
Quote originally posted by MSDN ...
Requirements

Header Declared in WinBase.h; include Windows.h.

Library Use Kernel32.lib.

DLL Requires Kernel32.dll.

Unicode Implemented as FindFirstVolumeW (Unicode) and FindFirstVolumeA (ANSI).
Then I created a MFC-application with unicode with MFC in a shared DLL, and used FindFirstVolumeW as recommended by MSDN.

Quote originally posted by jov0708 ...
ohh... anyway, i defined _WIN32_WINNT in my code
I'm using a precompiled header, but I have _WIN32_WINNT defined in stdafx.h. So there is no need to redefine it in your sourcecode.
Last edited by Nick Evan; Jan 23rd, 2011 at 3:49 pm.
Moderator
Featured Poster
Reputation Points: 4142
Solved Threads: 394
Industrious Poster
Nick Evan is online now Online
4,132 posts
since Oct 2006
Feb 6th, 2008
0

Re: need help in using FindFirstVolume() API

thanks... it's already working. i changed the value of _WIN32_WINNT in stdafx.h.

jov
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jov0708 is offline Offline
6 posts
since Feb 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: confused about clarification on class objects
Next Thread in C++ Forum Timeline: Which C++ complier to use





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC