Click to See Complete Forum and Search --> : MFC / C++


salman
May 11th, 1999, 01:01 PM
I am new to MFC / C/C++. I want to know 2 things.
first: Without using any control how to identify the CD Drive Letter so that the path can be set directly from within the program.

Second: I want to make a simulation for plant where i need to show about 500 machines. I want to show them by check boxex? Is is advisable or I should draw circles. More I want to associate a click event with that machines. How to make object array using MFC.

scp
May 11th, 1999, 01:33 PM
Here is the answer to your first question:

CString GetCDDrive()
{
for (int i = 1; i < 27; i++)
{
char chDrive = ((char)((i - 1 + 'A')));
CString strDrive = (CString)cDrive;
strDrive += ":";
UINT type = GetDriveType(strDrive);

switch(type)
{
case DRIVE_CDROM:
return strDrive;
default:
break;
}
}
}

If E:\ is the CD Drive this will return E:

HTH
Santhosh