1) How to detect if a CDRom is inserted into the CDRom drive?
Using:
Code Sample |
GetSystemInfo (CDROM, bisCDRomInserted, svResult); if( bisCDRomInserted = FALSE) then SprintfBox (WARNING, "CDRom warning", "CDRom drive empty! Insert CDRom and press OK"); endif; |
It seems to detect the CDRom drive presence, NOT the CDRom presence.
Nevertheless the Help says:
Code Sample |
GetSystemInfo (nItem, nvResult, svResult); nItem: CDROM nvResult: TRUE or FALSE Indicates whether a CD ROM is available. svResult: N/A |
2) In PC with more than one CDRom drive how is the simplest way to detect CDRom drive letter with inserted a CDRom (if one)?
2.1) This is my workaround to 2) problem:
Code Sample |
// Create a list to hold the CDRom drive names. lCDRom = ListCreate(STRINGLIST); // Get CDRom drives. if (GetValidDrivesList (lCDRom, CDROM_DRIVE, -1) < 0) then SprintfBox (SEVERE, "CDRom Error", "Unable to detect CDRom drive!"); else nCDRomDrive = ListCount (lCDRom); if (nCDRomDrive <= 0) then SprintfBox (SEVERE, "CDRom Error", "Unable to detect CDRom drive!"); elseif (nCDRomDrive > 1) then SdShowInfoList ("CDRom Warning", "This PC have more CDRom drivers!", lCDRom); // Help me to do this: // put list's item into a dialog box (i.e. AskOption) and let // the user choose the CDRom drive where he would put his CDRom(*) else // typical situation: PC with only one CD Rom drive! #ifdef DEBUG_LEVEL_1 SdShowInfoList ("CDRom Information", "CDRom drive letter is:", lCDRom); #endif ListGetFirstString (lCDRom, CDSetupRoot); CDSetupRoot = CDSetupRoot + ":\\"; #ifdef DEBUG_LEVEL_1 SprintfBox (INFORMATION, "CDRom information", "CDRom root directory is: %s", CDSetupRoot); #endif endif; endif; |
(*)browsing the Help It seems to me there is a way to do that:
Code Sample |
CtrlSetList(szDialogName, nControlID, listID); Description The CtrlSetList function places the contents of a string list into the specified single- or multi-selection list box or combo box control. Any pre-existing contents are replaced with the items contained in listID. InstallShield places each element of the string list into each element of the list box or combo box control |
But I found the implementation quite difficult, anyone can help me to better understand it?
What's a list box / combo box?
Is it possible to places the contents of a string list into a Dialog Box? (i.e. AskOption)
Thanks.
Ciao, Giuseppe