Habe es jetzt mit StrPCopy versucht. Es hat aber nichts genutzt.
So bekomme ich einen Ordner VIDEO_TS und die VIDEO_TS.VOB wird angelegt:
Delphi-Quellcode:
function TShrinkTo5.GetExecute: Integer;
var
StopFlag : String;
begin
StopFlag := '0';
Result := FNTransferPath(PChar(fTransferPath), PChar(stopFlag));
end;
Und so bekomme ich nur den Ordner:
Delphi-Quellcode:
function TShrinkTo5.GetExecute: Integer;
type
TThreadParams = record
TransferPath : String;
end;
PThreadParams = ^TThreadParams;
var
ThreadParams : PThreadParams;
hThread : THandle;
ThreadID : Cardinal;
lResult : Cardinal;
function Thread(p: PThreadParams): Cardinal;
var
PTransferPath : PAnsiChar;
PStopFlag : PAnsiChar;
lResult : Integer;
begin
PTransferPath := PAnsiChar(PThreadParams(p)^.TransferPath);
PStopFlag := PAnsiChar('0');
lResult := FNTransferPath(PTransferPath, PStopFlag);
FreeMem(p, sizeof(TThreadParams));
if lResult < 0
then Result := $0FFFFFFF - lResult
else Result := lResult;
end;
begin
Result := 0;
hThread := 0;
if DirectoryExists(fTransferPath)
then try
{
* Den Arbeitsthread erstellen
}
GetMem(ThreadParams, sizeof(TThreadParams));
ThreadParams.TransferPath := fTransferPath;
hThread := BeginThread(nil, 0, @Thread, ThreadParams, 0, ThreadID);
if hThread <> INVALID_HANDLE_VALUE
then begin
while WaitForSingleObject(hThread, 300) = WAIT_TIMEOUT
do Application.ProcessMessages;
{
* return codes for TransferPath
* >0 success - number of MegaBytes written
* 0 user aborted (stopFlag == 1)
* -2 if stream is scrambled and either descrambling failed or is disabled
* -5 source was not opened with "Open"
* -6 cannot authorize driveend;
}
end;
finally
GetExitCodeThread(hThread, lResult);
end;
if lResult > $0FFFfff0
then Result := lResult - $0FFFFFFF
else Result := lResult;}
end;