| |||||||
| Commercial message | |
| | |
|
![]() |
| | Thread Tools |
| | #1 (permalink) |
| New on Forum Join Date: Aug 2007 Location: Austria
Posts: 2
| getting error using NeroEraseDisc(...) I have the following Problem. When I try to erase a CDRW disc with using the nero API I always get error code 1 from NeroEraseDisc(...) returned. This only ahappens if i run the programm without debugging. If I debug the code (set a breakpoint on the top and step through) the erase process is successful. I have the same problem with when I write a disc. I use Nero API v7.0.5.6 Has anyone an idea??? My code looks like this: NERO_SCSI_DEVICE_INFO* nsdiDevice = (NERO_SCSI_DEVICE_INFO*)mcbxDevices.GetItemDataPtr(i); ndhDeviceHandle = NeroOpenDevice(nsdiDevice); if (!ndhDeviceHandle) { AppendString(_T("Device could not be opened: ") + (CString)nsdiDevice->nsdiDeviceName); } else { if (_tcscmp(nsdiDevice->nsdiDeviceName, _T("Image Recorder"))) { NERO_CD_INFO *pInfo = NeroGetCDInfo (ndhDeviceHandle,0); if (pInfo == NULL) { AppendString (_T("ERROR: can't get CD-Info")); NeroCloseDevice(ndhDeviceHandle); return; } NeroFreeMem(pInfo); } NEROAPI_CDRW_ERASE_MODE mode = NEROAPI_ERASE_QUICK; // Default is quickly int time; if(m_eEraseMode == eModeComplete) mode=NEROAPI_ERASE_ENTIRE; time=NeroGetCDRWErasingTime(ndhDeviceHandle, mode); if (time==-1) AppendString(_T("No CD inserted")); else if (time==-2) AppendString(_T("This CD recorder doesn't support CDRW")); else if (time==-3) AppendString(_T("This media is not rewritable")); CString strTemp; strTemp.Format(_T("Erasing CDRW. This will take %d seconds."), time); AppendString(strTemp); //get media type NERO_MEDIA_TYPE mediaType = NeroGetCurrentMediumType(ndhDeviceHandle); //get speed info NERO_SPEED_INFOS *speed = NeroGetAvailableSpeeds (ndhDeviceHandle, ACCESSTYPE_WRITE, mediaType, NULL); DWORD uiSpeedInKb = 150; //150kB == 1x speed if (speed != NULL) uiSpeedInKb = speed->nsiSupportedSpeedsKBs[speed->nsiNumSupportedSpeeds-1]; //get maximum speed int err = NeroEraseDisc(ndhDeviceHandle, mode, NEDF_DISABLE_EJECT /*don't eject disc*/, uiSpeedInKb ); NeroCloseDevice(ndhDeviceHandle); NeroFreeMem(speed); } |
| | |
| | #2 (permalink) |
| New on Forum Join Date: Aug 2007 Location: Austria
Posts: 2
| Re: getting error using NeroEraseDisc(...) Now I now the Problem: NeroOpenDevice(...); returns not NULL but needs some time to get ready. So, if I insert a Sleep(5000); after NeroOpenDevice it works. Has anybody a better solution? Thanks wagenwi |
| | |
| |
| |
![]() |
| If you can't find where you are looking for, then become a member and get an answer fast! We have thousands of people online every moment of the day to help you! Click here |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NeroEraseDisc returns NDE_GENERIC_ERROR | dietmarR | Nero SDK Discussion Forum | 1 | 21-09-2007 13:34 |
| how to get the process information for NeroEraseDisc | angelsky | Nero SDK Discussion Forum | 0 | 16-01-2007 01:05 |
| NeroEraseDisc Problem | ahatzig | Nero SDK Discussion Forum | 0 | 01-08-2005 10:27 |
| Return of NeroEraseDisc | phil1969 | Nero SDK Discussion Forum | 2 | 16-06-2004 11:44 |
| NeroEraseDisc progress | Bobby60 | Nero SDK Discussion Forum | 1 | 26-04-2004 19:43 |