need help in using FindFirstVolume() API

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Feb 2008
Posts: 6
Reputation: jov0708 is an unknown quantity at this point 
Solved Threads: 0
jov0708 jov0708 is offline Offline
Newbie Poster

need help in using FindFirstVolume() API

 
0
  #1
Feb 5th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,868
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 301
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Cenosillacaphobiac

Re: need help in using FindFirstVolume() API

 
0
  #2
Feb 5th, 2008
Originally Posted by jov0708 View Post
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.

Niek
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 176
Reputation: dubeyprateek is an unknown quantity at this point 
Solved Threads: 22
dubeyprateek's Avatar
dubeyprateek dubeyprateek is offline Offline
Junior Poster

Re: need help in using FindFirstVolume() API

 
0
  #3
Feb 5th, 2008
What is the error? You can always redifine _WIN32_WINNT as per your target OS
I know I am. Therefore I am.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 6
Reputation: jov0708 is an unknown quantity at this point 
Solved Threads: 0
jov0708 jov0708 is offline Offline
Newbie Poster

Re: need help in using FindFirstVolume() API

 
0
  #4
Feb 5th, 2008
Originally Posted by niek_e View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 6
Reputation: jov0708 is an unknown quantity at this point 
Solved Threads: 0
jov0708 jov0708 is offline Offline
Newbie Poster

Re: need help in using FindFirstVolume() API

 
0
  #5
Feb 6th, 2008
Originally Posted by niek_e View Post
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
niek,

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

jov
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,868
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 301
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Cenosillacaphobiac

Re: need help in using FindFirstVolume() API

 
0
  #6
Feb 6th, 2008
I looked here
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.

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.

Niek
Last edited by niek_e; Feb 6th, 2008 at 4:25 am.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 6
Reputation: jov0708 is an unknown quantity at this point 
Solved Threads: 0
jov0708 jov0708 is offline Offline
Newbie Poster

Re: need help in using FindFirstVolume() API

 
0
  #7
Feb 6th, 2008
thanks... it's already working. i changed the value of _WIN32_WINNT in stdafx.h.

jov
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC