checking to see if there is a cd?
is there a function to see the name of the cd (in c++)?
or is there another way for checking to see if you have the right cd in the cd-rom tray.
thanks in advanced.
Quote:Original post by silverphyre673
in what? I think it would depend on a number of things: your OS, your API, etc.
winxp, c++
The API is Win32, you will probably need to go searching though the platform sdk documentation for disc drive detection.
You can do the following checks to see if your CD-Rom is present:
- Check if the source drive is a CD-Rom Drive (using GetDriveType)
- Check if the volume label is OK (using GetVolumeInformation)
Hope that helps!
- Check if the source drive is a CD-Rom Drive (using GetDriveType)
- Check if the volume label is OK (using GetVolumeInformation)
Hope that helps!
SDL has some CD-ROM related functions, notably related to your problem is SDL_CDStatus.
Edit: Curse your evil, deceptice title!!! You want to know the name of the CD :-p. See SDL_CDName instead, then.
Quote:From the SDL documentation site: SDL_CDStatus
SDL_CDStatus
Name
SDL_CDStatus -- Returns the current status of the given drive.
Synopsis
#include "SDL.h"
CDstatus SDL_CDStatus(SDL_CD *cdrom);
/* Given a status, returns true if there's a disk in the drive */
#define CD_INDRIVE(status) ((int)status > 0)
[...]
Edit: Curse your evil, deceptice title!!! You want to know the name of the CD :-p. See SDL_CDName instead, then.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement