wpEjectDisk
Appearance
This method is specific to version 2.1, or higher, of the OS/2 operating system.
This instance method is used to ejection media from drives that support software eject of removable media.
Syntax
_wpEjectDisk(somSelf)
Parameters
- somSelf (WPDisk *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPDisk.
Returns
- rc (ULONG) - returns
- Return code from DosDevIOCtl category 8 Function 40.
- A return value of **NO_ERROR** indicates that the drive does not support lock and eject.
How to Override
This method should not be overridden.
Usage
This method can be called at any time to eject a disk from a drive.
Remarks
This method is not covered in the provided text.
Example Code
Definition:
#define INCL_WINWORKPLACE #include <os2.h> WPDisk *somSelf; /* Pointer to the object on which the method is being invoked. */ ULONG rc; /* Return code from DosDevIOCtl category 8 Function 40. */ rc = _wpEjectDisk(somSelf);
Example:
ULONG ulStatus = 0; /* Status returned from _wpEjectDisk */
APIRET rc = NO_ERROR; /* Return code from DosBeep */
/*
* Eject the disk from the drive
*/
if ((ulStatus=_wpEjectDisk( self )) == 0) {
somPrintf("Disk ejected. Waiting for next CD-ROM to be loaded.\n");
rc = DosBeep( 8000, 500 ); /* Beep to wake up the user */
} else {
somPrintf("_wpEjectDisk failed, return code=%u\n", ulStatus);
return 1;
} /* endif */