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.

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.

What is the error? You can always redifine _WIN32_WINNT as per your target OS

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.

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

I looked here

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.

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.

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

jov :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.