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;
|