|
-
May 17th, 2002, 06:21 AM
#1
How to get CD Label Information
Hello,
how can I get the CD label information?
thx
kingkong321
-
May 21st, 2002, 06:54 AM
#2
use
BOOL GetVolumeInformation(
LPCTSTR lpRootPathName, // root directory
LPTSTR lpVolumeNameBuffer, // volume name buffer
DWORD nVolumeNameSize, // length of name buffer
LPDWORD lpVolumeSerialNumber, // volume serial number
LPDWORD lpMaximumComponentLength, // maximum file name length
LPDWORD lpFileSystemFlags, // file system options
LPTSTR lpFileSystemNameBuffer, // file system name buffer
DWORD nFileSystemNameSize // length of file system name buffer
);
-
May 27th, 2002, 02:21 PM
#3
Hi curious,
Thank you for your help. It seems to be that this is the function I searched for. But how to use it? I always get an error.
Code:
#include <iostream.h>
#include <windows.h>
void main ()
{
char *VolumeNameBuffer,
*FileSystemNameBuffer;
DWORD VolumeNameSize,
FileSystemNameSize,
*VolumeSerialNumber,
*MaximumComponentLength,
*FileSystemFlags;
VolumeNameBuffer=0;
FileSystemNameBuffer=0;
VolumeNameSize=0;
FileSystemNameSize=0;
VolumeSerialNumber=0;
MaximumComponentLength=0;
FileSystemFlags=0;
GetVolumeInformation("c:\\", VolumeNameBuffer, VolumeNameSize, VolumeSerialNumber, MaximumComponentLength, FileSystemFlags, FileSystemNameBuffer, FileSystemNameSize);
cout << VolumeNameBuffer << endl;
}
thx
kingkong321
-
May 28th, 2002, 11:55 PM
#4
#include <iostream.h>
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
_TCHAR VolumeNameBuffer[MAX_PATH+1],
FileSystemNameBuffer[MAX_PATH+1];
DWORD VolumeNameSize = sizeof(FileSystemNameBuffer),
FileSystemNameSize = sizeof(FileSystemNameBuffer),
VolumeSerialNumber = 0,
MaximumComponentLength = 0,
FileSystemFlags = 0,
lastError;
VolumeSerialNumber=0;
MaximumComponentLength=0;
FileSystemFlags=0;
if (!::GetVolumeInformation(_T("G:\\"), VolumeNameBuffer, VolumeNameSize, &VolumeSerialNumber, &MaximumComponentLength, &FileSystemFlags, FileSystemNameBuffer, FileSystemNameSize))
lastError = ::GetLastError();
cout << VolumeNameBuffer << endl;
}
Hi - try this. It worked for me. I changed the NULL pointers to arrays, amongst other things.
RD
-
May 29th, 2002, 02:51 PM
#5
Hi R. J. Dunnill
thank you very much. your posting mehlped me to get what i searched for. ;-)
thanks!!!
Regards,
kingkong321
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|