Need to GetDriveType(), BUT...

I have a very large VC++ .NET (2003) program I've spent months writing.  I need to use the GetDriveType() function, which seems to require #including windows.h.  However, whenever I #include windows.h, it breaks hundreds of other commands in my code.  I'm able to use System::IO::Directory::GetLogicalDrives(), but GetDriveType() isn't in that class.  Can anybody suggest a way to get around this

Answer this question

Need to GetDriveType(), BUT...

  • ashitabh

    The DriveInfo class in .Net 2.0 may be what you are looking for. 

    The DriveType property tells you what kind of drive (network, disk, etc) it is. 

     

    http://msdn2.microsoft.com/en-us/library/system.io.driveinfo.aspx



  • Syed Moiz

    Thanks, Ben.  I downloaded both the framework and the SDK, installed them both.  My Visual C++ Studio help displays that I'm still using the 1.1 framework, though, and now I can't open my project.  (Nothing is simple anymore!)  Any ideas
  • shiras

    OK, so MS almost hides the fact that you have to purchase Visual Studio 2005 in order to make use of .Net 2.0.  I swallowed my pride, bought VS2005, and now I can use DriveInfo.  Thanks.
  • Need to GetDriveType(), BUT...