0

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.

3
Contributors
6
Replies
7
Views
9 Years
Discussion Span
Last Post by jov0708
0

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.

Edited by Nick Evan: n/a

0

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.

0

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

Edited by Nick Evan: n/a

0

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.

Edited by Nick Evan: n/a

0

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

jov :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.