Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. How to code DriveInfo class

How to code DriveInfo class

Scheduled Pinned Locked Moved Managed C++/CLI
csharpvisual-studiocomhelptutorial
5 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dragon52
    wrote on last edited by
    #1

    I am using VS.NET 2003. I want to use the DriveInfo class to get the volume label of the logical drives on my PC. According to Microsoft doc the DriveInfo class is part of the System::IO namespace (see "http://msdn2.microsoft.com/en-us/library/system.io.driveinfo.aspx"). But the declaraion "DriveInfo* myDriveInfo" produces a compile error. The compiler does not know about the DriveInfo class. Does any one know what I have done wrong?? Eg. it knows about "System::IO::Directory" but not "System::IO::DriveInfo" dragon_n

    M 1 Reply Last reply
    0
    • D dragon52

      I am using VS.NET 2003. I want to use the DriveInfo class to get the volume label of the logical drives on my PC. According to Microsoft doc the DriveInfo class is part of the System::IO namespace (see "http://msdn2.microsoft.com/en-us/library/system.io.driveinfo.aspx"). But the declaraion "DriveInfo* myDriveInfo" produces a compile error. The compiler does not know about the DriveInfo class. Does any one know what I have done wrong?? Eg. it knows about "System::IO::Directory" but not "System::IO::DriveInfo" dragon_n

      M Offline
      M Offline
      Milton Karimbekallil
      wrote on last edited by
      #2

      This is a .Net 2.0 class. So you cant use it in VS2003. It works fine in VS2005 cheers...MIlton Kb

      D 1 Reply Last reply
      0
      • M Milton Karimbekallil

        This is a .Net 2.0 class. So you cant use it in VS2003. It works fine in VS2005 cheers...MIlton Kb

        D Offline
        D Offline
        dragon52
        wrote on last edited by
        #3

        Thanks Milton. So do you know how I can get logical drive info such as drive label? I have seen examples using GetVolumeInformation function (in VB) that uses types such as DWORD & UINT which I am not familiar with and don't know how to translate into C++.NET

        M 1 Reply Last reply
        0
        • D dragon52

          Thanks Milton. So do you know how I can get logical drive info such as drive label? I have seen examples using GetVolumeInformation function (in VB) that uses types such as DWORD & UINT which I am not familiar with and don't know how to translate into C++.NET

          M Offline
          M Offline
          Milton Karimbekallil
          wrote on last edited by
          #4

          Why cant u write the application in C++/Cli VS2005? It supports this driveinfo. cheers..milton.

          D 1 Reply Last reply
          0
          • M Milton Karimbekallil

            Why cant u write the application in C++/Cli VS2005? It supports this driveinfo. cheers..milton.

            D Offline
            D Offline
            dragon52
            wrote on last edited by
            #5

            I am using VS2003. I don't have VS2005. I am rewriting in VB.Net now so I can use "GetVolumeInformation". You know VB?? I am hitting another brickwall in VB. One of the parameters used by "GetVolumeInformation" is declared as Dim driveLabel As String = Space(200) This string has length of 200 (driveLabel.length = 200)even if the useful part of the string is only 5 chars long (say "Tommy ... " ) Do you know how I can extract the useful part of "driveLabel" in VB?? I might ask this question on the VB MessageBoard

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups