#1 Burning Software

It is currently Thu Dec 19, 2024 5:09 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Building List of Burn Files
PostPosted: Thu Nov 16, 2006 4:53 am 
Offline

Joined: Tue Oct 31, 2006 12:25 am
Posts: 43
Hi

I'm just getting started with StarBurn and am attempting to modify your GUI demo to burn files to disk without using a TListView (because my burning needs are simple; put some files in the root folder and put some files in a sub-folder).

Alas, I'm having some difficulty getting my head around the documentation.

When I use the process below to build the file list i get the error:

StarBurn_CdvdBurnerGrabber_TrackAtOnceFromFile() failed, exception 5, status 3, text "CStarBurn_DiskFile::CStarBurn_DiskFile(): CreateFile( '' ) failed, status 3!!!"

Presumably that means I am passing a null filename...

Please advise where i am going wrong...

Thanks



// create the file tree for burning files to disk
procedure TMainForm.BuildBurnFileList;
var
ParentNode: Pointer;
SubFolderNode: Pointer;

// Create our sub-folder on the disk and return the pointer to it
function _GetSubFolderNode(sbParentNode: Pointer; sFolderName:String): Pointer;
begin
result:=nil;

// Log
Logger.Log('StarBurn_ISO9660JolietFileTree_Add');
// Add new virtual node to tree
Burner.sbException := StarBurn_ISO9660JolietFileTree_Add(
Burner.ISO9660JolietFileTree,
PChar(@Burner.ExceptionText[1]),
SizeOf(Burner.ExceptionText),
Burner.SystemError,
nil,
PChar(sFolderName),
FILE_TIME_LAST_WRITE,
sbParentNode,
result);

// Check add result
if (Burner.sbException <> EN_SUCCESS) then
begin
Burner.Message := Format('StarBurn_ISO9660FileTree_Add() failed, ' +
'exception %d, status %d, text "%s"',
[Integer(Burner.sbException), Burner.SystemError,
PAnsiChar(@Burner.ExceptionText[1])]);
// Log
Logger.Log(Burner.Message);
end;
end;

// Add the file in the root or the sub-folder (optionally with a new name)
function _AddFile(sFileName: string; bInSubFolder:boolean; sNameOnDisk:String=''):boolean;
var
AddedNode: Pointer;
pNameOnDisk: Pointer;
pPutInNode: Pointer;
begin
result:=false;
Application.ProcessMessages;

If ParentNode=nil then
ParentNode:= StarBurn_ISO9660JolietFileTree_GetRoot(Burner.ISO9660JolietFileTree);

if bInSubFolder then
begin
if SubFolderNode=nil then SubFolderNode:=_GetSubFolderNode(ParentNode,'SubFolder');
pPutInNode:= SubFolderNode;
end
else
begin
pPutInNode:= ParentNode;
end;

if (sNameOnDisk='') or (ExtractFileName(sFilename)=sNameOnDisk) then
pNameOnDisk:=nil
else
pNameOnDisk:=pchar(sNameOnDisk);

Logger.Log('StarBurn_ISO9660JolietFileTree_Add');

Burner.sbException := StarBurn_ISO9660JolietFileTree_Add(
Burner.ISO9660JolietFileTree,
PChar(@Burner.ExceptionText[1]),
SizeOf(Burner.ExceptionText),
Burner.SystemError,
PChar(sFileName),
pNameOnDisk,
FILE_TIME_LAST_WRITE,
pPutInNode,
AddedNode);

Application.ProcessMessages;
if (Burner.sbException = EN_SUCCESS) then
begin
Result := TRUE;
end
else
begin
Burner.Message := Format('StarBurn_ISO9660FileTree_Add() failed, ' +
'exception %d, status %d, text "%s"',
[Integer(Burner.sbException), Burner.SystemError,
PAnsiChar(@Burner.ExceptionText[1])]);
// Log
Logger.Log(Burner.Message);
end;
end;

var
I: Integer;
sFilename,sNameOnDisk:string;
bPutInRoot:boolean;
begin
ParentNode:=nil;
SubFolderNode:=nil;
Burner.PrepareFileTree;

// Add Test Files
_AddFile(ApplicationFolder+'autorun.inf',TRUE);
_AddFile(ApplicationFolder+'Setup.exe',FALSE);
end;


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 12:17 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Look at the console Pascal samples. They seems to be better source for the task you wish to solve.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 8:03 pm 
Offline

Joined: Tue Oct 31, 2006 12:25 am
Posts: 43
Hi Anton

Yes, i already looked at the Console samples. As far as I can tell I am calling it correctly. Can you see anything in particular wrong with this code?

Also, where can i find a description of the error codes?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 9:44 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
No, I don't see anything exactly wrong.

Windows errors are in winerror.h (or it's equivalent for Delphi), StarBurn errors in StarBurn.h or StarBurn.pas I guess.

xexx wrote:
Hi Anton

Yes, i already looked at the Console samples. As far as I can tell I am calling it correctly. Can you see anything in particular wrong with this code?

Also, where can i find a description of the error codes?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 50 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group