help:About multisession question

if i want to burn the same CD time after time, how do i implement?

now, after i once burn the CD, twice burn the CD. Then first burned files is not seen.In explore, the second burned file can be seen.Why?

As follows is the setting of burn’s flags.

NERO_BURN_FLAGS flags = (NERO_BURN_FLAGS) ( NERO_BURN_FLAG_WRITE | NERO_BURN_FLAG_DAO |NERO_BURN_FLAG_CLOSE_SESSION|NERO_BURN_FLAG_BUF_UNDERRUN_PROT |NERO_BURN_FLAG_DISABLE_ABORT | NERO_BURN_FLAG_DETECT_NON_EMPTY_CDRW | NERO_BURN_FLAG_SPEED_IN_KBS);

Befor burning a second compilation you must import the last track.
her a sample code

NERO_IMPORT_DATA_TRACK_INFO nidtInfo;
NERO_IMPORT_DATA_TRACK_RESULT nidtResult;

	// IMPORT DES SESSIONS PRECEDENTES : Prepare the struct
	CString csUserMsg		= "";
	memset(&nidtInfo, 0, sizeof(nidtInfo));
	nidtInfo.nidtiSize		= sizeof(nidtInfo);
	void* pCDStamp			= NULL;
	NERO_ISO_ITEM* pniiItem	= NULL;
	NERO_MEDIA_TYPE			m_MediaType;
	NERO_CD_INFO* pnciInfo	= NeroGetCDInfo(ndhDeviceHandle, NGCDI_READ_CD_TEXT | NGCDI_READ_ISRC);
	if(pnciInfo != NULL)
	{
		m_MediaType = pnciInfo->ncdiMediaType ;
		//pniiItem = NeroImportDataTrack(ndhDeviceHandle, pnciInfo->ncdiNumTracks - 1, &pCDStamp, &nidtInfo, NIITEF_IMPORT_VMS_SESSION, &nidtResult, NULL);
		pniiItem = NeroImportDataTrack(ndhDeviceHandle, pnciInfo->ncdiNumTracks - 1, &pCDStamp, &nidtInfo, 0, &nidtResult, NULL);
		NeroFreeMem(pnciInfo);
	}
	

	// If there is a volume name after import, print it out. : NOM DU CD/DVD
	if(nidtInfo.nidtipVolumeName != NULL)
	{
		csUserMsg.Format("Imported volume name: %s", nidtInfo.nidtipVolumeName);
		mFileLog->WriteString(csUserMsg);
		NeroFreeMem (nidtInfo.nidtipVolumeName);
	}
	
	// If there was an error during import, let the user know about it.
	if((nidtResult != NIDTR_NO_ERROR) || (pniiItem == NULL))
	{
		static LPCSTR errors[] = {"an unknown error","a generic error","a drive error","a read error","a filesystem error","an invalid track number"};

		if (nidtResult > NIDTR_INVALID_TRACKNUMBER)
			nidtResult = NIDTR_NO_ERROR;

		csUserMsg.Format("There was %s while importing the track!", errors[nidtResult]);
		mFileLog->WriteString(csUserMsg);
	}
	else if(pItemIso != NULL)
	{
		if(MergeIsoTrack(&pniiItem,pItemIso )) // Merge the new track with the existing one. 
			writeCD.nwcdpCDStamp = pCDStamp;
		else
		{
			mFileLog->WriteString("There was an error while merging tracks!");
			if(pCDStamp != NULL)
				NeroFreeCDStamp(pCDStamp), pCDStamp = NULL;
		}
	}


	// AJOUT FRMETURE CD 
	DWORD dwFlags = NCITEF_CREATE_ISO_FS | NCITEF_USE_JOLIET ;//| NBF_CLOSE_SESSION;

	//writeCD.nwcdIsoTrack = NeroCreateIsoTrackEx(pItemIso, vNumeroCd, NCITEF_CREATE_ISO_FS|NCITEF_USE_JOLIET);
	if(pniiItem!=NULL)
		writeCD.nwcdIsoTrack = NeroCreateIsoTrackEx(pniiItem, vNumeroCd, dwFlags);
	else
		writeCD.nwcdIsoTrack = NeroCreateIsoTrackEx(pItemIso, vNumeroCd, dwFlags);

	//iRes = NeroBurn(ndhDeviceHandle, NERO_ISO_AUDIO_MEDIA, &writeCD, NBF_WRITE|NBF_CLOSE_SESSION, 0, &npProgress);
	
	DWORD m_BurnSpeed;
	m_BurnSpeed = nsdiDevice->nsdiWriteSpeeds.nsiNumSupportedSpeeds;
	
	NERO_SPEED_INFOS* TSpeed=NeroGetAvailableSpeeds(ndhDeviceHandle,ACCESSTYPE_WRITE,m_MediaType,NULL);
	int noExist_Speeds = TSpeed->nsiNumSupportedSpeeds;
	
   // start the burn process by calling NeroBurn
   // usage:NEROAPI_BURN_ERROR NADLL_ATTR NeroBurn( NERO_DEVICEHANDLE  aDeviceHandle,
   // NERO_CD_FORMAT  CDFormat, const void*  pWriteCD, DWORD  dwFlags, DWORD  dwSpeedInX,
   // NERO_PROGRESS*  pNeroProgress);
   //
   // aDeviceHandle = ndhDeviceHandle, the handle we got from NeroOpenDevice()
   // CDFormat = NERO_ISO_AUDIO_CD
   // pWriteCD = writeCD
   // dwFlags = NBF_WRITE, do not simulate - burn! NBF_CLOSE_SESSION means close only the session not the entire disc.
   // dwSpeedInX = 0, use maximum speed
   // pNeroProgress = npProgress, filled during NeroAPIInit()

	if (!bCloseCD)
		iRes = NeroBurn(ndhDeviceHandle, NERO_ISO_AUDIO_MEDIA, &writeCD, NBF_WRITE|NBF_CLOSE_SESSION, 0, &npProgress);
	else
		iRes = NeroBurn(ndhDeviceHandle, NERO_ISO_AUDIO_MEDIA, &writeCD, NBF_WRITE|0, 0, &npProgress);

	//iRes = NeroBurn(m_ndhDeviceHandle, NERO_ISO_AUDIO_CD, m_pnwcWriteCD, NBF_WRITE | (!m_chkbxClose.GetCheck() ? NBF_CLOSE_SESSION : 0), 0, &m_npProgress);

	NeroFreeIsoTrack(writeCD.nwcdIsoTrack);
	NeroCloseDevice(ndhDeviceHandle);