I have a D2 application I recently compiled with D3. Aside from the Quick
Reports and a few new/renamed.moved units, all went relatively well. Now,
however, one section of my previously stable codes produces an access
violation when the SHELLEXECUTE routine is called in the following
program. Anyone know why or, most importantly, how to work around the
problem.
Thanks in advance.
function ExecuteFile(const FileName, Params, DefaultDir: string; ShowCmd:
Integer): Boolean;
var
zFileName, zParams, zDir: array[0..79] of Char;
begin
{open file using command such as ExecuteFile(FileName, '',
Directory, SW_SHOW); }
Result := (ShellExecute(Application.MainForm.Handle, nil,
StrPCopy(zFileName, FileName), StrPCopy(zParams, Params),
StrPCopy(zDir, DefaultDir), ShowCmd) > 32);
end;
Note: this is an almost exact duplicate of the routine in FMXUtils.pas in
the D2 and D3 demo programs.
M. Scott St.Cyr
Cyrious Software, Inc.
//***************************************************************//