|
vbAccelerator - Contents of code file: gIMAPI.clsThis file is part of the download VB5 IMAPI Library Source, which is described in the article Image Mastering API (IMAPI) Library for VB. VERSION 1.0 CLASS BEGIN MultiUse = -1 'True END Attribute VB_Name = "gIMAPI" Attribute VB_GlobalNameSpace = True Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit Private Const SEVERITY_SUCCESS = 0 Private Const SEVERITY_ERROR = 1 Private Const FACILITY_ITF = 4 Public Enum IMAPI_ERROR_CODES IMAPI_S_PROPERTIESIGNORED IMAPI_S_BUFFER_TO_SMALL IMAPI_E_NOTOPENED IMAPI_E_NOTINITIALIZED IMAPI_E_USERABORT IMAPI_E_GENERIC IMAPI_E_MEDIUM_NOTPRESENT IMAPI_E_MEDIUM_INVALIDTYPE IMAPI_E_DEVICE_NOPROPERTIES IMAPI_E_DEVICE_NOTACCESSIBLE IMAPI_E_DEVICE_NOTPRESENT IMAPI_E_DEVICE_INVALIDTYPE IMAPI_E_INITIALIZE_WRITE IMAPI_E_INITIALIZE_ENDWRITE IMAPI_E_FILESYSTEM IMAPI_E_FILEACCESS IMAPI_E_DISCINFO IMAPI_E_TRACKNOTOPEN IMAPI_E_TRACKOPEN IMAPI_E_DISCFULL IMAPI_E_BADJOLIETNAME IMAPI_E_INVALIDIMAGE IMAPI_E_NOACTIVEFORMAT IMAPI_E_NOACTIVERECORDER IMAPI_E_WRONGFORMAT IMAPI_E_ALREADYOPEN IMAPI_E_WRONGDISC IMAPI_E_FILEEXISTS IMAPI_E_STASHINUSE IMAPI_E_DEVICE_STILL_IN_USE IMAPI_E_LOSS_OF_STREAMING IMAPI_E_COMPRESSEDSTASH IMAPI_E_ENCRYPTEDSTASH IMAPI_E_NOTENOUGHDISKFORSTASH IMAPI_E_REMOVABLESTASH IMAPI_E_CANNOT_WRITE_TO_MEDIA IMAPI_E_TRACK_NOT_BIG_ENOUGH IMAPI_E_BOOTIMAGE_AND_NONBLANK_DISC End Enum Public Property Get IMAPIErrorDescription(ByVal iCode As IMAPI_ERROR_CODES) As String Attribute IMAPIErrorDescription.VB_Description = "Gets the description for an entry in the IMAPI_ERROR_CODE enumeration." Dim sMsg As String Select Case iCode Case IMAPI_S_PROPERTIESIGNORED sMsg = "An unknown property was passed in a property set and it was ignored." Case IMAPI_E_NOTOPENED sMsg = "A call to IDiscMaster::Open has not been made." Case IMAPI_E_NOTINITIALIZED sMsg = "A recorder object has not been initialized." Case IMAPI_E_USERABORT sMsg = "The user canceled the operation." Case IMAPI_E_GENERIC sMsg = "A generic error occurred." Case IMAPI_E_MEDIUM_NOTPRESENT sMsg = "There is no disc in the device." Case IMAPI_E_MEDIUM_INVALIDTYPE sMsg = "The media is not a type that can be used." Case IMAPI_E_DEVICE_NOPROPERTIES sMsg = "The recorder does not support any properties." Case IMAPI_E_DEVICE_NOTACCESSIBLE sMsg = "The device cannot be used or is already in use." Case IMAPI_E_DEVICE_NOTPRESENT sMsg = "The device is not present or has been removed." Case IMAPI_E_DEVICE_INVALIDTYPE sMsg = "The recorder does not support an operation." Case IMAPI_E_INITIALIZE_WRITE sMsg = "The drive interface could not be initialized for writing." Case IMAPI_E_INITIALIZE_ENDWRITE sMsg = "The drive interface could not be initialized for closing." Case IMAPI_E_FILESYSTEM sMsg = "An error occurred while enabling/disabling file system access or during auto-insertion detection." Case IMAPI_E_FILEACCESS sMsg = "An error occurred while writing the image file." Case IMAPI_E_DISCINFO sMsg = "An error occurred while trying to read disc data from the device." Case IMAPI_E_TRACKNOTOPEN sMsg = "An audio track is not open for writing." Case IMAPI_E_TRACKOPEN sMsg = "An open audio track is already being staged." Case IMAPI_E_DISCFULL sMsg = "The disc cannot hold any more data." Case IMAPI_E_BADJOLIETNAME sMsg = "The application tried to add a badly named element to a disc." Case IMAPI_E_INVALIDIMAGE sMsg = "The staged image is not suitable for a burn. It has been corrupted or cleared and has no usable content." Case IMAPI_E_NOACTIVEFORMAT sMsg = "An active format master has not been selected using IDiscMaster::SetActiveDiscMasterFormat." Case IMAPI_E_NOACTIVERECORDER sMsg = "An active disc recorder has not been selected using IDiscMaster::SetActiveDiscRecorder." Case IMAPI_E_WRONGFORMAT sMsg = "A call to IJolietDiscMaster has been made when IRedbookDiscMaster is the active format, or vice versa. To use a different format, change the format and clear the image file contents." Case IMAPI_E_ALREADYOPEN sMsg = "A call to IDiscMaster::Open has already been made against this object by your application." Case IMAPI_E_WRONGDISC sMsg = "The IMAPI multi-session disc has been removed from the active recorder." Case IMAPI_E_FILEEXISTS sMsg = "The file to add is already in the image file and the overwrite flag was not set." Case IMAPI_E_STASHINUSE sMsg = "Another application is already using the IMAPI stash file required to stage a disc image. Try again later." Case IMAPI_E_DEVICE_STILL_IN_USE sMsg = "Another application is already using this device, so IMAPI cannot access the device." Case IMAPI_E_LOSS_OF_STREAMING sMsg = "Content streaming was lost; a buffer under-run may have occurred." Case IMAPI_E_COMPRESSEDSTASH sMsg = "The stash is located on a compressed volume and cannot be read." Case IMAPI_E_ENCRYPTEDSTASH sMsg = "The stash is located on an encrypted volume and cannot be read." Case IMAPI_E_NOTENOUGHDISKFORSTASH sMsg = "There is not enough free space to create the stash file on the specified volume." Case IMAPI_E_REMOVABLESTASH sMsg = "The selected stash location is on a removable media." Case IMAPI_E_MEDIUM_NOTPRESENT sMsg = "There is no media in the drive to query." Case Else sMsg = "IMAPI Error with code [" & iCode & "]" End Select IMAPIErrorDescription = sMsg End Property Public Function DecodeIMAPIError(ByVal err As Long) As IMAPI_ERROR_CODES Attribute DecodeIMAPIError.VB_Description = "Converts a VB Err.Number thrown by the VBIMAPI library into the equivalent IMAPI Error code." Dim iCode As IMAPI_ERROR_CODES If err = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, &H200 + 0) Then iCode = IMAPI_S_PROPERTIESIGNORED ElseIf err = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, &H200 + 1) Then iCode = IMAPI_S_BUFFER_TO_SMALL ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 11) Then iCode = IMAPI_E_NOTOPENED ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 12) Then iCode = IMAPI_E_NOTINITIALIZED ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 13) Then iCode = IMAPI_E_USERABORT ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 14) Then iCode = IMAPI_E_GENERIC ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 15) Then iCode = IMAPI_E_MEDIUM_NOTPRESENT ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 16) Then iCode = IMAPI_E_MEDIUM_INVALIDTYPE ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 17) Then iCode = IMAPI_E_DEVICE_NOPROPERTIES ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 18) Then iCode = IMAPI_E_DEVICE_NOTACCESSIBLE ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 19) Then iCode = IMAPI_E_DEVICE_NOTPRESENT ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 20) Then iCode = IMAPI_E_DEVICE_INVALIDTYPE ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 21) Then iCode = IMAPI_E_INITIALIZE_WRITE ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 22) Then iCode = IMAPI_E_INITIALIZE_ENDWRITE ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 23) Then iCode = IMAPI_E_FILESYSTEM ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 24) Then iCode = IMAPI_E_FILEACCESS ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 25) Then iCode = IMAPI_E_DISCINFO ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 26) Then iCode = IMAPI_E_TRACKNOTOPEN ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 27) Then iCode = IMAPI_E_TRACKOPEN ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 28) Then iCode = IMAPI_E_DISCFULL ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 29) Then iCode = IMAPI_E_BADJOLIETNAME ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 30) Then iCode = IMAPI_E_INVALIDIMAGE ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 31) Then iCode = IMAPI_E_NOACTIVEFORMAT ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 32) Then iCode = IMAPI_E_NOACTIVERECORDER ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 33) Then iCode = IMAPI_E_WRONGFORMAT ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 34) Then iCode = IMAPI_E_ALREADYOPEN ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 35) Then iCode = IMAPI_E_WRONGDISC ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 36) Then iCode = IMAPI_E_FILEEXISTS ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 37) Then iCode = IMAPI_E_STASHINUSE ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 38) Then iCode = IMAPI_E_DEVICE_STILL_IN_USE ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 39) Then iCode = IMAPI_E_LOSS_OF_STREAMING ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 40) Then iCode = IMAPI_E_COMPRESSEDSTASH ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 41) Then iCode = IMAPI_E_ENCRYPTEDSTASH ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 42) Then iCode = IMAPI_E_NOTENOUGHDISKFORSTASH ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 43) Then iCode = IMAPI_E_REMOVABLESTASH ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 44) Then iCode = IMAPI_E_CANNOT_WRITE_TO_MEDIA ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 45) Then iCode = IMAPI_E_TRACK_NOT_BIG_ENOUGH ElseIf err = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, &H200 + 46) Then iCode = IMAPI_E_BOOTIMAGE_AND_NONBLANK_DISC End If DecodeIMAPIError = iCode End Function
|
|||
|
||||
|