| |||||||
| Commercial message | |
| | |
|
![]() |
| | Thread Tools |
| | #1 (permalink) |
| New on Forum Join Date: Feb 2004
Posts: 17
| Initialization failure Hi! I'm trying to implement a small library, so that others are able to burn data to DVD/CDRW. I'm using NeroSDK 1.03 (planning to change to 1.04 soon), MSVC++ Enterprise Edition 6.0. Nero is installed with version 5.5.10.42. I've already looked at the ressources that came with the NeroSDK, but found no solution to the following problem: When calling NeroBurn(m_sDH, NERO_ISO_AUDIO_MEDIA, psNWCD, dwBOpt.GetCurrentOptions(), 0, 0) it returns with NEROAPI_BURN_ERROR and GetLastError tells me "Initialization failed". So, obviously something must be wrong ;-)
I also collected the files to burn in an IsoItemTree and built an ISO track from this using NeroCreateIsoTrackEx. This worked fine. Calling NeroBurn with just this data set gives me the above mentioned "Initialization failure" - which seems quite fine to me, because up until now, I haven't put the ISO track into the psNWCD structure. However, if I set psNWCD->nmcdIsoTrack to the ISO track I've built from the ISO tree, I don't get this NEROAPI_BURN_ERROR any longer - but an access violation. This is also, if I fill in any other fields in the psNWCD struct. Any help? Regards, Thorsten |
| | |
| | #2 (permalink) | ||
| New on Forum Join Date: Feb 2004
Posts: 17
| Re: Initialization failure Hi! Quote:
Quote:
Any help? Regards, Thorsten | ||
| | |
| | #3 (permalink) |
| Nero Developer Join Date: Jun 2003
Posts: 209
| I see two possible problems: 1) You set nwcdNumTracks to 1, but it looks like you want to burn only the iso track and no audio tracks. nwcdNumTracks refers to the number of audio tracks. 2) You set nwcdMediaType to MEDIA_DVD_ANY|MEDIA_CDRW. This is not supported. You have to set it to a single media type like MEDIA_DVD_ANY or MEDIA_CD. |
| | |
| | #4 (permalink) | ||
| New on Forum Join Date: Feb 2004
Posts: 17
| Hi! Sorry for my late reply, but I haven't been in the office yesterday. Quote:
Quote:
I figured out, that the media type shows a strange behaviour in a different subject as well: I had used (MEDIA_DVD_ANY|MEDIA_CDRW) as well when looking for the available drives (NeroGetAvailableDrivesEx). As expected this returned with a list of available devices ;-) Strangely enough, however, the write speeds array was completely filled with 0 (read speeds array was fine, though). Changing the first parameter of GetAvailableDrivesEx to MEDIA_NONE fixed this. If I remember correctly, this was not the case when using V5.5.10.42. If you want me to verify this, just let me know and I try to reinstall the older version, if possible. Regards, Thorsten | ||
| | |
| | #6 (permalink) | |
| New on Forum Join Date: Feb 2004
Posts: 17
| Hi! Quote:
{"version number deleted Windows 2000 5.0 IA32 WinAspi: - ahead WinASPI: File 'C:\Programme\Ahead\Nero\Wnaspi32.dll': Ver=2.0.1.59, size=160016 bytes, created 16.12.2003 19:18:06 Nero API version: 6.3.0.3 Using interface version: 6.3.0.0 " Regards, Thorsten | |
| | |
| | #7 (permalink) |
| New on Forum Join Date: Feb 2004
Posts: 17
| Hi! Perhaps the actual code does help much more than just a textual description. I have included it with this post. Code that is not related to Nero has been removed as well as most of the error handling, version checking, etc. I'm basically doing this in my burning routine: { int iNumTracks; int iSize; NEROAPI_BURN_ERROR result; NERO_WRITE_CD* psNeroWriteCD; NERO_ISO_ITEM* ppIsoItem = NULL; // Calculate the size required for NERO_WRITE_CD plus the given number of tracks // (at the moment we always write a single track containing all files as IsoItems) iNumTracks = 0; iSize = sizeof(NERO_WRITE_CD) + (iNumTracks-1)*sizeof(NERO_AUDIO_TRACK); // Allocate a WriteCD structure and fill it with null bytes. psNeroWriteCD = (NERO_WRITE_CD*) new char[iSize]; memset (psNeroWriteCD, 0, iSize); psNeroWriteCD->nwcdNumTracks = iNumTracks; // there is no extra audio on this disk, so: psNeroWriteCD->nwcdCDExtra = false; psNeroWriteCD->nwcdMediaType = static_cast // Set the ISO track data CBurnOptions dwBurnOptions(m_sNeroDeviceInfo.nsdiCapabilities); CreateIsoTrack ("Test", psNeroWriteCD->nwcdIsoTrack); // Actually burn all data using the currently selected device. // NERO_ISO_AUDIO_MEDIA tells the burn process to detect the kind of media using the nwcdMediaType member within the WRITE_CD structure (third parameter). // (DWORD) 204 is currently used, because this is the value NeroCmd uses as well - and NeroCmd does work. result = NeroBurn (m_sDevHandle, NERO_ISO_AUDIO_MEDIA, psNeroWriteCD, (DWORD) 204, 0, 0); if (NEROAPI_BURN_FAILED == result) { CString error = NeroGetLastError(); CString log = NeroGetErrorLog(); } } with the following important subroutines. These are more or less identical with those in NeroCmd: // Create an ISO track void CVideoArchivierung::CreateIsoTrack (const CString sName, CNeroIsoTrack** ppIsoTrack) { NERO_ISO_ITEM* psIsoItemRoot = NULL; NERO_CITE_ARGS citeArgs; psIsoItemRoot = CreateIsoItemTree(); memset (&citeArgs, 0, sizeof (citeArgs)); citeArgs.firstRootItem = psIsoItemRoot; citeArgs.name = (LPCTSTR)sName; // (ULONG) 16385 is currently used, because this is the value NeroCmd uses as well - and NeroCmd does work. citeArgs.dwBurnOptions = (ULONG) 16385; /* NCITEF_CREATE_ISO_FS; */ // Finally, create the ISO track. *ppIsoTrack = NeroCreateIsoTrackEx (NULL, (const char*) &citeArgs, NCITEF_USE_STRUCT); } and // Create an ISO item tree from all files in the working directory. NERO_ISO_ITEM* CVideoArchivierung::CreateIsoItemTree() { NERO_ISO_ITEM* psIsoItemRoot = NULL; NERO_ISO_ITEM* psIsoItem = NULL; BOOL bMoreFiles; CFileFind finder; CString aFile; // Walk through the current working directory and throw all items into the ISO tree. bMoreFiles = finder.FindFile((LPCTSTR)m_sWorkingDirectory); while (bMoreFiles) { bMoreFiles = finder.FindNextFile(); // We have to skip the elements "." and ".." if (!finder.IsDots()) { CTime ftime; time_t t; if (finder.GetCreationTime(ftime)) { t = ftime.GetTime(); } // Remember the root of all items if (NULL == psIsoItemRoot) { psIsoItemRoot = NeroCreateIsoItem(); psIsoItem = psIsoItemRoot; } else { psIsoItem->nextItem = NeroCreateIsoItem(); psIsoItem = psIsoItem->nextItem; } memset(psIsoItem, 0, sizeof(NERO_ISO_ITEM)); StoreString (psIsoItem->fileName, psIsoItem->longFileName, finder.GetFileName()); StoreString (psIsoItem->sourceFilePath, (char*)psIsoItem->longSourceFilePath, finder.GetFilePath()); psIsoItem->isDirectory = finder.IsDirectory(); psIsoItem->isReference = false; psIsoItem->subDirFirstItem = NULL; psIsoItem->itemSize = sizeof(NERO_ISO_ITEM); psIsoItem->entryTime = *localtime (&t); } } return psIsoItemRoot; } If I take a look at the ISO item tree in the debugger, the one generated by the routine above is nearly identical to that generated by NeroCmd (except for addresses, of course). I wrote nearly identical, because this code sorts filenames in reverse order compared to NeroCmd. That's no deal here, however, because in my test directory there is just one file. I'm not in any way an expert in C or C++ (this is my first project in this language actually), so I might have made some really stupid mistake. Please let me know, if this is the case. Regards, |
| | |
| | #8 (permalink) |
| New on Forum Join Date: Feb 2004
Posts: 17
| Hi! I've done some more tests on this subject, because this error still bothers me. Both my program as well as NeroCmd call the same NeroAPI library routines before building the ISO tree and before calling NeroCreateIsoTrackEx. The only difference I currently see, is that my routine (see post above) sorts the directory entries in reverse order compared to NeroCmd. This, however, could not really make a difference, could it? So, I did some memory dumps of the relevant parts before and after calling NeroCreateIsoTrackEx. These are the results: My Program: NeroCmd: =========== ======== Before calling CreateIsoTrack with *ppIsoTrack = NeroCreateIsoTrackEx (NULL, (const char*) &citeArgs, NCITEF_USE_STRUCT); Memorydump of &citeArgs: 0012F54C 00 00 00 00 0012F600 00 00 00 00 .size 0012F550 48 77 CA 01 0012F604 00 78 22 01 .firstRootItem 0012F554 00 00 00 00 0012F608 00 00 00 00 .firstRootItem_wrapper 0012F558 3C 19 30 00 0012F60C EA 0E 80 00 .name 0012F55C 01 40 00 00 0012F610 01 40 00 00 .dwBurnOptions 0012F560 00 00 00 00 0012F614 00 00 00 00 .systemidentifier 0012F564 00 00 00 00 0012F618 00 00 00 00 .volumeSet 0012F568 00 00 00 00 0012F61C 00 00 00 00 .publisher 0012F56C 00 00 00 00 0012F620 00 00 00 00 .dataPreparer 0012F570 00 00 00 00 0012F624 00 00 00 00 .application 0012F574 00 00 00 00 0012F628 00 00 00 00 .copyright 0012F578 00 00 00 00 0012F62C 00 00 00 00 .abstract 0012F57C 00 00 00 00 0012F630 00 00 00 00 .bibliographic It can be seen that there is no difference, except for the value of pointers (which is to be expected). Examining the name pointer shows that they both point to the string "Test" (followed by a null byte). After calling CreateIsoTrack: Memorydump of ppIsoTrack: 003018A8 A8 AF CA 01 00801C58 60 B0 22 01 Memorydump of *ppIsoTrack: 01CAAFA8 A0 C6 A9 00 0122B060 A0 C6 19 10 01CAAFAC 01 40 00 00 0122B064 01 40 00 00 dwBurnOptions? 01CAAFB0 54 65 73 74 0122B068 54 65 73 74 "Test" 01CAAFB4 00 00 00 00 0122B06C 00 00 00 00 01CAAFB8 00 00 00 00 0122B070 00 00 00 00 01CAAFBC 00 00 00 00 0122B074 00 00 00 00 01CAAFC0 00 00 00 00 0122B078 00 00 00 00 01CAAFC4 00 00 00 00 0122B07C 00 00 00 00 01CAAFC8 00 00 00 00 0122B080 00 00 00 00 01CAAFCC 00 00 00 00 0122B084 00 00 00 00 01CAAFD0 00 00 00 00 0122B088 00 00 00 00 01CAAFD4 00 00 00 00 0122B08C 00 00 00 00 01CAAFD8 00 00 00 00 0122B090 00 00 00 00 01CAAFDC 00 00 00 00 0122B094 00 00 00 00 01CAAFE0 00 00 00 00 0122B098 00 00 00 00 01CAAFE4 00 00 00 00 0122B09C 00 00 00 00 01CAAFE8 00 00 00 00 0122B0A0 00 00 00 00 01CAAFEC 00 00 00 00 0122B0A4 00 00 00 00 01CAAFF0 00 00 00 00 0122B0A8 00 00 00 00 01CAAFF4 00 00 00 00 0122B0AC 00 00 00 00 01CAAFF8 00 00 00 00 0122B0B0 00 00 00 00 01CAAFFC 00 00 00 00 0122B0B4 00 00 00 00 01CAB000 00 00 00 00 0122B0B8 00 00 00 00 01CAB004 00 00 00 00 0122B0BC 00 00 00 00 01CAB008 00 00 00 00 0122B0C0 00 00 00 00 01CAB00C 00 00 00 00 0122B0C4 00 00 00 00 01CAB010 00 00 00 00 0122B0C8 00 00 00 00 01CAB014 00 00 00 00 0122B0CC 00 00 00 00 01CAB018 00 00 00 00 0122B0D0 00 00 00 00 01CAB01C 00 00 00 00 0122B0D4 00 00 00 00 01CAB020 00 00 00 00 0122B0D8 00 00 00 00 01CAB024 00 00 00 00 0122B0DC 00 00 00 00 01CAB028 00 00 00 00 0122B0E0 00 00 00 00 01CAB02C 00 00 00 00 0122B0E4 00 00 00 00 01CAB030 00 00 00 00 0122B0E8 00 00 00 00 01CAB034 00 00 00 00 0122B0EC 00 00 00 00 01CAB038 00 00 00 00 0122B0F0 00 00 00 00 01CAB03C 00 00 00 00 0122B0F4 00 00 00 00 01CAB040 00 00 00 00 0122B0F8 00 00 00 00 01CAB044 00 00 00 00 0122B0FC 00 00 00 00 01CAB048 00 00 00 00 0122B100 00 00 00 00 01CAB04C 00 00 00 00 0122B104 00 00 00 00 01CAB050 00 00 00 00 0122B108 00 00 00 00 01CAB054 00 00 00 00 0122B10C 00 00 00 00 01CAB05C 00 00 00 00 0122B110 00 00 00 00 01CAB060 00 00 00 00 0122B114 00 00 00 00 01CAB064 00 00 00 00 0122B118 00 00 00 00 01CAB068 00 00 00 00 0122B11C 00 00 00 00 01CAB06C 00 00 00 00 0122B120 00 00 00 00 01CAB070 00 00 00 00 0122B124 00 00 00 00 01CAB074 00 00 00 00 0122B128 00 00 00 00 01CAB078 00 00 00 00 0122B12C 00 00 00 00 01CAB07C 00 00 00 00 0122B130 00 00 00 00 01CAB080 00 00 00 00 0122B134 00 00 00 00 01CAB084 00 00 00 00 0122B138 00 00 00 00 01CAB088 00 00 00 00 0122B13C 00 00 00 00 01CAB08C 00 00 00 00 0122B140 00 00 00 00 01CAB090 00 00 00 00 0122B144 00 00 00 00 01CAB094 00 00 00 00 0122B148 00 00 00 00 01CAB098 00 00 00 00 0122B14C 00 00 00 00 01CAB09C 00 00 00 00 0122B150 00 00 00 00 01CAB0A0 00 00 00 00 0122B154 00 00 00 00 01CAB0A4 00 00 00 00 0122B158 00 00 00 00 01CAB0A8 00 00 00 00 0122B15C 00 00 00 00 01CAB0AC 00 00 00 00 0122B160 00 00 00 00 01CAB0B0 00 00 00 00 0122B164 00 00 00 00 01CAB0B4 48 77 CA 01 0122B168 00 00 00 00 .firstRootItem in MyProgram 01CAB0B8 00 00 00 00 0122B16C 00 78 22 01 .firstRootItem in NeroCmd 01CAB0BC 00 00 00 00 0122B170 00 00 00 00 01CAB0C0 14 B1 AE 00 0122B174 00 00 00 00 01CAB0C4 14 B1 AE 00 0122B178 14 B1 1E 10 01CAB0C8 14 B1 AE 00 0122B17C 14 B1 1E 10 01CAB0CC 14 B1 AE 00 0122B180 14 B1 1E 10 01CAB0D0 08 C8 CA 01 0122B184 14 B1 1E 10 .firstRootItem+$50C0 in MyProgram 01CAB0D4 14 B1 AE 00 0122B188 58 C8 22 01 .firstRootItem+$5058 in NeroCmd 01CAB0D8 14 B1 AE 00 0122B18C 14 B1 1E 10 01CAB0DC 14 B1 AE 00 0122B190 14 B1 1E 10 01CAB0E0 0D F0 AD BA 0122B194 14 B1 1E 10 01CAB0E4 0D F0 AD BA 0122B198 0D F0 AD BA 01CAB0E8 AB AB AB AB 0122B19C 0D F0 AD BA 01CAB0EC AB AB AB AB 0122B1A0 AB AB AB AB 01CAB0F0 00 00 00 00 0122B1A4 AB AB AB AB 01CAB0F4 00 00 00 00 0122B1A8 00 00 00 00 01CAB0F8 C3 00 2B 00 0122B1AC 00 00 00 00 01CAB0FC 00 04 EE FE 0122B1B0 B6 00 2B 00 01CAB100 78 01 CA 01 0122B1B4 00 04 EE FE 01CAB104 78 01 CA 01 0122B1B8 E8 CF 22 01 0122B1BC 78 01 22 01 The problem here is that I don't know the meaning of the components of **ppIsoTrack. I've thus dumped all parts that deem relevant to me up until the value of .firstRootItem (which was given as part of &citeArgs when calling NeroCreateIsoTrackEx) appeared. It can be seen that there is a difference between what my program received and what the NeroCmd program received as output of NeroCreateIsoTrackEx. The first four bytes are not identical, but seem to be a pointer to something. So, they might differ of course. However, we then see that there are a lot of identical bytes (mostly 00 00 00 00) up until the value of .firstRootItem appears for the first time. In the return value in neroCmd, however, this value appears four bytes later then it appears in my program. All following bytes (up until AB AB AB AB 00 00 00 00 00 00 00 00) also have an offset of 4 bytes. Obviously, this is not correct in my program - but why? Regards, Thorsten |
| | |
| | #10 (permalink) | |
| New on Forum Join Date: Feb 2004
Posts: 17
| Hi! Quote:
Is there somewhere a function to debug an ISO track? Or is there any information on the layout of an ISO track? Regards, Thorsten | |
| | |
| | #11 (permalink) |
| Nero Developer Join Date: Jun 2003
Posts: 209
| The iso track returned by NeroCreateIsoTrackEx is of type CNeroIsoTrack which is defined in NeroIsoTrack.h. Maybe this helps. Does the error log not say more than what you pasted above? If not, could you please use NeroGetLastErrors(x, NGLE_REPORT, NULL). This should give me some more information where the error actually happened. |
| | |
| | #12 (permalink) | ||
| New on Forum Join Date: Feb 2004
Posts: 17
| Quote:
Quote:
error LNK2001: Unresolved external symbol _NeroGetLastErrors I'm linking against NeroAPIGlue.lib and NeroAPIGlueRT.lib. Is there any other library I should link against - and where can I find it? Regards, Thorsten | ||
| | |
| | #13 (permalink) | |
| Nero Developer Join Date: Jun 2003
Posts: 209
| Quote:
Maybe this is the problem. Otherwise it is very strange, that you get an unresolved external symbol. Are you sure, you are using the NeroAPIGlue.lib of NeroSDK 1.04? | |
| | |
| | #14 (permalink) | ||
| New on Forum Join Date: Feb 2004
Posts: 17
| Quote:
I'm still getting the unresolved symbol linker error. Quote:
The libs in C:\NeroSDK-v1.04\NeroAPI\Lib are of size - NeroAPIGlue.lib: 142.782 Bytes - NeroAPIGlueRT.lib: 143.006 Bytes Regards, Thorsten | ||
| | |
| | #16 (permalink) | |
| New on Forum Join Date: Feb 2004
Posts: 17
| Quote:
I just realized that the error log I posted above was not complete. Sorry about that. Here's the complete error log, which might be of more help to you, matze, because there's a line number given in NeroAPI.cpp (line 4875): Code:
Thorsten | |
| | |
| | #17 (permalink) |
| Nero Developer Join Date: Jun 2003
Posts: 209
| Sorry, this doesn't help. And unfortunately I don't have any idea currently, what could be the reason for this problem. I would suggest that you try to find the difference to the NeroCMD source. Not just the actual iso track generating code but maybe also the other source code. |
| | |
| | #18 (permalink) | |
| New on Forum Join Date: Feb 2004
Posts: 17
| Quote:
Thanks for your help so far. I have already found some errors in my code with the information provided both in this and in other threads here. Since the beginning of this thread I've done a lot of tests to track down this "Initialization failure" problem. It seems to me, some relevant change has been done in the burn routine between Nero V5.5.10.42 and Nero V6.x.x.x. I've done tests with these Nero versions - Nero V5.5.10.42 - Nero V6.3.0.0 - Nero V6.3.0.3 - Nero V6.1.3.6 using both SDK-v1.03 and SDK-v1.04. I've tried this on several machines here with different CDRW or DVD drives. The following program parts works fine with Nero V5.5.10.42 (I do not have any older versions available here), but fails to burn with "Initialization failure" as soon as I switch to any Nero V6.x.x.x version. The SDK version does not affect this behaviour. Neither does the drive (CDRW or DVD) affect it. The member variables of this class (e.g. m_sNeroDeviceInfo) are of course declared and set correctly outside these routines. For the sake of brevity I have also removed all error handling (e.g. checking whether memory has been allocated (and the like). Code: CVA::Burn(const string sName)
{
int iNumTracks;
int iSize;
bool success;
CBurnOptions dwBurnOptions(m_sNeroDeviceInfo.nsdiCapabilities);
NEROAPI_BURN_ERROR result;
NERO_WRITE_CD* psNeroWriteCD;
NERO_ISO_ITEM* ppIsoItem = NULL;
// Calculate the size required for NERO_WRITE_CD structure. As there are no tracks, this is
// is fairly easy (tracks are used only in case of audio media).
iNumTracks = 0;
iSize = sizeof(NERO_WRITE_CD) + (iNumTracks-1)*sizeof(NERO_AUDIO_TRACK);
// Allocate a WriteCD structure and fill it with null bytes.
psNeroWriteCD = (NERO_WRITE_CD*) new char[iSize];
memset (psNeroWriteCD, 0, iSize);
// Set structure to refer to data to be burnt.
psNeroWriteCD->nwcdNumTracks = iNumTracks;
// the title will be the sName
psNeroWriteCD->nwcdTitle = sName.c_str();
// we do not have an audio CD, so there is no artist, no special CD and also no extra audio track
psNeroWriteCD->nwcdArtist = NULL;
psNeroWriteCD->nwcdCDExtra = false;
psNeroWriteCD->nwcdpCDStamp = NULL;
// Depending on the kind of medium available, we have to set the media type filter. Otherwise
// we will receive an initialization error when trying to burn.
CMedium medium;
medium.GetMediumInfo(m_sDevHandle);
if (medium.IsCDRW())
{
psNeroWriteCD->nwcdMediaType = static_cast Code: bool CVA::GetIsoTrack(const string sName, CNeroIsoTrack** ppIsoTrack, NERO_ISO_ITEM** ppItem)
{
*ppIsoTrack = NULL;
NERO_ISO_ITEM* pItem=NULL;
bool result = false;
// Create a tree from the the files found in our working directory.
CreateIsoItemTree(GetWorkingDirectory(), &pItem);
*ppItem = pItem;
if (NULL != *ppItem)
{
NERO_CITE_ARGS citeArgs;
memset (&citeArgs, 0, sizeof (citeArgs));
// We want to create all data as it appears in our working directory, i.e. long
// filenames (NCITEF_USE_JOLIET) and have the medium readable on most drives
// (NCITEF_USE_MODE2).
citeArgs.dwBurnOptions = NCITEF_USE_MODE2 | NCITEF_USE_JOLIET;
citeArgs.name = sName.c_str();
citeArgs.firstRootItem = *ppItem;
// Finally, create the ISO track.
DebugPrintIsoTree(*ppItem, 0); Code: // *ppIsoTrack = NeroCreateIsoTrackEx (pItem, sName.c_str(), (DWORD) (NCITEF_USE_MODE2 | NCITEF_USE_JOLIET));
*ppIsoTrack = NeroCreateIsoTrackEx (NULL, (const char *) &citeArgs, NCITEF_USE_STRUCT);
// If the ISO track could not be created then delete the ISO item tree and return with
// an error.
if (NULL != *ppIsoTrack)
{
result = true;
}
}
return result;
} Code: CVA::CreateIsoItemTree(string sStartDir, NERO_ISO_ITEM** pItemRoot)
{
NERO_ISO_ITEM* pCurrentItem = *pItemRoot;
CFileFinder finder(sStartDir);
// Walk through the current working directory and throw all items into the ISO tree.
while (finder.IsValidEntry())
{
// We have to skip the elements "." and ".." that are returned by the finder.
if (!finder.IsDots())
{
time_t t = finder.GetCreationTime();
// If this is the first item, we have to remember it as the root of all items,
// otherwise append the new item to the existing item list.
if (NULL == *pItemRoot)
{
*pItemRoot = NeroCreateIsoItem();
pCurrentItem = *pItemRoot;
}
else
{
pCurrentItem->nextItem = NeroCreateIsoItem();
pCurrentItem = pCurrentItem->nextItem;
}
// Fill in the necessary information, i.e. target filename, source filename
// (including path), whether it's directory and file creation time.
// StoreString is identical to the one defined in NeroCmd.
StoreString (pCurrentItem->fileName,
pCurrentItem->longFileName,
(LPCTSTR)finder.GetFileName());
StoreString (pCurrentItem->sourceFilePath,
(char*)pCurrentItem->longSourceFilePath,
finder.GetFilePath().append(finder.GetFileName()));
pCurrentItem->isDirectory = finder.IsDirectory();
pCurrentItem->isReference = false;
pCurrentItem->subDirFirstItem = NULL;
pCurrentItem->itemSize = sizeof(NERO_ISO_ITEM);
pCurrentItem->entryTime = *localtime (&t);
// Distinguish between directories and plain files
if (finder.IsDirectory())
{
string sDir = finder.GetFilePath();
sDir.append(finder.GetFileName());
CreateIsoItemTree(sDir, &pCurrentItem->subDirFirstItem);
}
}
finder.FindNextFile();
}
}
void CA::DebugPrintIsoTree (const NERO_ISO_ITEM * pItem, int iLevel)
{
while (pItem)
{
string indent(iLevel*2, ' ');
// Indent each level a little bit.
cout << indent << "fileName : [" << pItem->fileName << "]" << endl;
cout << indent << "longFileName : [" << ((NULL == pItem->longFileName) ? "" : pItem->longFileName) << "]" << endl;
cout << indent << "isDirectory : " << (pItem->isDirectory ? "true" : "false" ) << endl;
cout << indent << "isReference : " << (pItem->isReference ? "true" : "false" ) << endl;
cout << indent << "sourceFilePath : [" << pItem->sourceFilePath << "]" << endl;
cout << indent << "longSourceFilePath: [" << ((NULL == pItem->longSourceFilePath) ? "" : pItem->longSourceFilePath) << "]" << endl;
cout << indent << "nextItem : " << (long)pItem->nextItem << endl;
cout << indent << "userData : " << (long)pItem->userData << endl;
cout << indent << "dataStartSec : " << pItem->dataStartSec << endl;
cout << indent << "dataLength : " << (long)pItem->dataLength << endl;
cout << indent << "itemSize : " << pItem->itemSize << endl;
cout << indent << "importInfo : " << (long)pItem->importinfo << endl;
// If it is a directory, show next level
if (pItem->isDirectory)
{
DebugPrintIsoTree (pItem->subDirFirstItem, iLevel + 1);
}
pItem = pItem->nextItem;
}
} I do call - NeroAPIGlueConnect - NeroInit - NeroGetAvailableDrivesEx - NeroOpenDevice - NeroEraseCDRW (or NeroEraseDisc when testing with V6.x.x.x) before calling the CVA::Burn routine. None of these routines return with an error condition. The output (see call of DebugPrintIsoTree in GetIsoTrack and call of NeroGetErrorLog after NeroBurn) shows - when using Nero V6.x.x.x (serial number manually deleted) Code: fileName : [File1] longFileName : [] isDirectory : false isReference : false sourceFilePath : [C:\temp\File1] longSourceFilePath: [] nextItem : 0 userData : 0 dataStartSec : 0 dataLength : 0 itemSize : 592 importInfo : 0 Nero error: < ####-####-####-####-####-#### Windows 2000 5.0 IA32 WinAspi: - ahead WinASPI: File 'C:\Programme\Ahead\Nero\Wnaspi32.dll': Ver=2.0.1.59, size=160016 bytes, created 16.12.2003 19:18:06 Nero API version: 6.3.1.6 Using interface version: 6.3.0.0 Installed in: C:\Programme\Ahead\Nero\ Application: ahead\Nero - Burning Rom Recorder: Code: fileName : [File1] longFileName : [] isDirectory : false isReference : false sourceFilePath : [C:\temp\File1] longSourceFilePath: [] nextItem : 0 userData : 0 dataStartSec : 0 dataLength : 0 itemSize : 592 importInfo : 0 Nero error: < ####-####-####-####-####-#### Windows 2000 5.0 IA32 WinAspi: - ahead WinASPI: File 'C:\Programme\Ahead\Nero\Wnaspi32.dll': Ver=2.0.1.59, size=160016 bytes, created 29.01.2003 22:37:36 Nero API version: 5.5.10.42 Using interface version: 6.3.0.0 Installed in: C:\Programme\Ahead\Nero\ Application: ahead\Nero - Burning Rom Recorder: Regards Thorsten | |
| | |
| | #19 (permalink) |
| New on Forum Join Date: Mar 2004
Posts: 2
| Initialization failed I've the same error. A question to the makers of the toolkit: What is the meaning of the log line: 29.3.2004 NeroAPI 14:24:04 #1 NEROAPI 2 File NeroAPI.cpp, Line 4875 Initialization failed ??? I use the following code: if (!m_NeroDeviceHandle) return 1; // / no dvd drive NERO_ISO_ITEM *pItem = NeroCreateIsoItem(); strcpy(pItem->fileName,"Test.exe"); strcpy(pItem->sourceFilePath,"E:\\temp\\test.exe"); CNeroIsoTrack *pIsoTrack = NeroCreateIsoTrackEx (pItem,"TEST", NCITEF_USE_JOLIET|NCITEF_CREATE_ISO_FS); ASSERT (pIsoTrack!=NULL); // finally, burn the CD NERO_WRITE_CD writeCD; ZeroMemory(&writeCD, sizeof(writeCD)); writeCD.nwcdIsoTrack = pIsoTrack; writeCD.nwcdNumTracks = 0; // number of audio (!) tracks writeCD.nwcdMediaType=MEDIA_CD; // type NEROAPI_BURN_ERROR err=NeroBurn(m_NeroDeviceHandle,NERO_ISO_AUDIO_MEDIA,&writeCD, NBF_WRITE, // write CD 0, // use maximum speed NULL); // no progress (currently) // ... //here I've got the error "Initialization failed" !!! Do you have any idea?? |
| | |
| | #20 (permalink) |
| New on Forum Join Date: Mar 2004
Posts: 2
| HEUREKA! I've finally found your (and my) mistake: THE LAST PARAMETER OF BURN() IS NOT ALLOWED TO BE EMPTY!!! You have to pass a NERO_PROGRESS structure there. Of course, you can set most of the callback functions to NULL in that structure. Please reply if your problem is solved now. |
| | |
| | #21 (permalink) | |
| New on Forum Join Date: Feb 2004
Posts: 17
| Re: HEUREKA! Quote:
You saved my day! :-))) This indeed was the problem! I've just tested it with Nero V6.1.3.6 and a NeroProgress structure filled completely with NULL - and all went fine. Regards Thorsten | |
| | |
| |
| |