Hi, All
Have the following function in my program (a procedure checks for updated data file on form creation and if found calls this function) -
function WinCopyFile(Source, Dest: string): Boolean;
var
Struct : TSHFileOpStruct;
Resultval: integer;
begin
ResultVal := 1;
try
Source := Source + #0#0;
Dest := Dest + #0#0;
Struct.wnd := 0;
Struct.wFunc := FO_COPY;
Struct.pFrom := PChar(Source);
Struct.pTo := PChar(Dest);
Struct.fFlags:= FOF_SIMPLEPROGRESS or FOF_NOERRORUI or FOF_NOCONFIRMATION;
Struct.fAnyOperationsAborted := False;
Struct.hNameMappings := nil;
Resultval := ShFileOperation(Struct);
finally
Result := (Resultval = 0);
end;
end;
Worked fine until we had latest security updates to OS (NT4) and MS Office (2000) after which the following error is reported when the function is called -
'Access violation at address 77F34EB5 in module ‘kernel32.dll’. Read of address B2D21C11'
Any ideas?
Thanks in advance..
Have the following function in my program (a procedure checks for updated data file on form creation and if found calls this function) -
function WinCopyFile(Source, Dest: string): Boolean;
var
Struct : TSHFileOpStruct;
Resultval: integer;
begin
ResultVal := 1;
try
Source := Source + #0#0;
Dest := Dest + #0#0;
Struct.wnd := 0;
Struct.wFunc := FO_COPY;
Struct.pFrom := PChar(Source);
Struct.pTo := PChar(Dest);
Struct.fFlags:= FOF_SIMPLEPROGRESS or FOF_NOERRORUI or FOF_NOCONFIRMATION;
Struct.fAnyOperationsAborted := False;
Struct.hNameMappings := nil;
Resultval := ShFileOperation(Struct);
finally
Result := (Resultval = 0);
end;
end;
Worked fine until we had latest security updates to OS (NT4) and MS Office (2000) after which the following error is reported when the function is called -
'Access violation at address 77F34EB5 in module ‘kernel32.dll’. Read of address B2D21C11'
Any ideas?
Thanks in advance..