Copy Entire DVD to Blank DVDR by NeroSDK

Dear all,

I want to Copy a Entire DVD to Blank DVDR by my own program.

how to do it?

Using NeroBurn (handle,NERO_BURN_IMAGE_MEDIA…,…), how to set the parameters?

oo91234,
Best way forward is to get youself a Dual Layer Disk. Use program
Ripit4me to create an ISO then burn with IMGBURN to burn ISO.
N.B… Ripit4me and Imgburn are both Free :bigsmile: :bigsmile:

// This function is responsible for burning an ISO image.
BOOL CCopieCDDVD::WriteImage ()
{
// Make sure that an image file name has been provided by the user
CString vNumeroCd;

m_NomCD.GetWindowText(vNumeroCd);
if (AfxMessageBox ("		Copie du CD/DVD : " + vNumeroCd + " 

Insérer dans le Graveur ‘" + m_TypeGarvureA + "’ un CD/DVD vierge",MB_OKCANCEL|MB_ICONQUESTION) == IDCANCEL)
{
return FALSE;
}

// Initialisation Nero API
mFileLog->WriteString ("Initialisation API Nero");
NeroAPIInit();

ndhDeviceHandle = NeroOpenDevice(nsdiDevice);
int iRes = FALSE;

if (!ndhDeviceHandle)
{
	CString m_Tmp;
	m_Tmp.Format("%s",nsdiDevice->nsdiDeviceName);
	mFileLog->WriteString("Device could not be opened: " + m_Tmp);
	NeroAPIFree();
	return FALSE;
}
else
{
	
	///////////////////////////////////
	//DEMANDE INSERTION CD/DVD VIERGE
	//////////////////////////////////
	while (!CheckCDVierge())
	{
		if (AfxMessageBox ("		Copie du CD/DVD : " + vNumeroCd + " 

Vérifiez que le Graveur ‘" + m_TypeGarvureA + "’ contient un CD/DVD vierge",MB_OKCANCEL|MB_ICONQUESTION) == IDCANCEL)
{
//NeroFreeMem(Log);
NeroCloseDevice(ndhDeviceHandle);
return FALSE;
}
}

	NERO_WRITE_IMAGE writeCD;
	
	memset (&writeCD, 0, sizeof (writeCD));

	// Fill in the image file name
	writeCD.nwiLongImageFileName = m_PathTMP + "\\IMG01.nrg";


	// Set DVD as media type if the user requested so
	/*if (params.GetUseDVD())
	{
		writeCD.nwiMediaType = MEDIA_DVD_ANY;
	}
	else
	{	
		writeCD.nwiMediaType = (NERO_MEDIA_TYPE) params.GetMediaType ();
	}*/
	
	writeCD.nwiMediaType = MEDIA_NONE;

	// Try to set layer break for this burning.
	/*if(((writeCD.nwiMediaType & MEDIA_DVD_P_R9) != 0) && (params.GetOptionLayerBreak() > 0))
	{
		DWORD dwLBA = params.GetOptionLayerBreak();
		NeroSetDeviceOption(m_NeroDeviceHandle, NERO_DEVICEOPTION_LAYERSWITCH, &dwLBA);
	}

	// Modify spare area settings on BD
	if(((writeCD.nwiMediaType & MEDIA_BD) != 0) && (params.GetSpareArea() != SAS_UNDEFINED))
	{
		NERO_SPARE_AREA_SETTINGS nSA = params.GetSpareArea();
		NeroSetDeviceOption(m_NeroDeviceHandle, NERO_DEVICEOPTION_SPARE_AREA, &nSA);
	}

	NEROAPI_BURN_ERROR err;
	CBurnContextProgress m_NeroProgress;
	*/
	
	
	theApp.IconCloseDoc = FALSE;
	m_Progression.SetPos(0);
	m_Progression.SetRange(0,100);
	m_Pourcent.SetWindowText("0 %");

/* err = NeroBurn (m_NeroDeviceHandle,
NERO_BURN_IMAGE_MEDIA,
&writeCD,
GetBurnFlags (params),
params.GetSpeedToNeroBurn (),
m_NeroProgress);
*/
// Burn the image
iRes = NeroBurn(ndhDeviceHandle, NERO_BURN_IMAGE_MEDIA, &writeCD, NBF_WRITE|0, 0, &npProgress);

	NeroCloseDevice(ndhDeviceHandle);
	//NeroFreeIsoTrack(writeCD.nwcdIsoTrack);
		
	mbAborted = false;

	char* Log = NeroGetErrorLog();

	mFileLog->WriteString(Log);
	NeroFreeMem(Log);
	//NeroFreeIsoItemTree(pItemIso);

	switch(iRes)
	{
		case NEROAPI_BURN_OK:
		  mFileLog->WriteString("BurnCD() : burn successful");
		  break;
		case NEROAPI_BURN_UNKNOWN_CD_FORMAT:
		  mFileLog->WriteString("BurnCD() : unknown CD format");
		  break;
		case NEROAPI_BURN_INVALID_DRIVE:
		  mFileLog->WriteString("BurnCD() : invalid drive");
		  break;
		case NEROAPI_BURN_FAILED:
		  mFileLog->WriteString("BurnCD() : burn failed");
		  break;
		case NEROAPI_BURN_FUNCTION_NOT_ALLOWED:
		  mFileLog->WriteString("BurnCD() : function not allowed");
		  break;
		case NEROAPI_BURN_DRIVE_NOT_ALLOWED:
		  mFileLog->WriteString("BurnCD() : drive not allowed");
		  break;
		case NEROAPI_BURN_USER_ABORT:
		  mFileLog->WriteString("BurnCD() : user aborted");
		  break;
		case NEROAPI_BURN_BAD_MESSAGE_FILE:
		  mFileLog->WriteString("BurnCD() : bad message file");
		  break;
		default:
		  mFileLog->WriteString("BurnCD() : unknown error");
		  break;
	}
	if ( iRes == NEROAPI_BURN_OK)
	{
		m_Resultat.SetWindowText("Gravure de l'image du CD/DVD " + vNumeroCd + " Succès");
		mFileLog->WriteString("Gravure de l'image " + vNumeroCd + " Succès");
	}
	else
	{
		//AppendString("Copie du CD/DVD " + vNumeroCd,"Echec",2);
		mFileLog->WriteString("Gravure de l'image " + vNumeroCd + " Echec");
	}
}

theApp.IconCloseDoc = TRUE;	

if ( iRes == NEROAPI_BURN_OK)
	return TRUE;
else
	return FALSE;

}

You must create an ISO IMAGE before using this function