CompuServe Thread

GetVolInfo problem?

1 messages in this thread
#79238From: SyndesisSep 17, 1994 12:26 PM
I've got a case of "it works under the debugger, but not under WinNT". Under WinNT and VC 1.1, the following code works when run under the debugger. When I run as a Program Manager icon, or via Project / Execute, I get a "No disk" stop-sign dialog, warning "there is no disk in drive." I can tap "ignore", it comes back but dismisses after the second "ignore." char volName[ 256 ]; strcpy( volName, "" ); GetVolumeInformation( ptr, // lpRootPathName volName, sizeof(volName), // lpVolumeNameBuffer, NULL, // lpVolumeSerialNumber, NULL, // lpMaximumComponentLength, NULL, // lpFileSystemFlags, NULL, 0 ); // lpFileSystemNameBuffer, nFileSystemNameSize) I get the list of drives from GetLogicalDriveStrings(). I adapted this code straight from the examples and docs in VC and MSDN Level 2. Also, I note that GetVolumeInformation() takes a relatively long time to execute. This was true of the examples, too. Is there a better way to get volume names? How do the Common Dialogs get the nicer list of volume names (mixed case, network mapping, etc.) without so much delay? Read action !