-1

I have a viewer to show my saved reports. Delphi XE7 works all right. But, on new version (Delphi Tokyo) it doesn't work.

if OpenDialog.Execute then 
   ShellExecute (0, nil, 'C:\C_Progs\CrystalViewer.exe', 
PWideChar('"' +OpenDialog.FileName+ '"'), nil, SW_ShowMaximized);

It's curious, since it only occurs when I select a file from a mapped drive.

ERROR: The application was unable to start correctly (0xc0000001). Click OK to close the application

LU RD
  • 34,438
  • 5
  • 88
  • 296
Seeko
  • 75
  • 1
  • 8
  • 1
    CreateProcess would be the normal way to start a new process. What is the value of OpenDialog.FileName? That's the first debugging step to take. – David Heffernan Aug 07 '18 at 12:29
  • Sorry... In Debug OpenDialogs.FileName = "\\tsclient\C\Temp\file_139376.rpt".. – Seeko Aug 07 '18 at 18:10
  • I think is a problem from Delphi version, because don't have any difference. The problem is when i selected a file in delphi Tokyo and the file is on a mapped server.. – Seeko Aug 07 '18 at 18:18
  • That's not a mapped path, that's a UNC path – David Heffernan Aug 07 '18 at 18:19

1 Answers1

-1

Solution: i was used the TOpenDialog component, but i changed to TFileOpenDialog. I don't understand why, but it worked.

Seeko
  • 75
  • 1
  • 8
  • I'm not sure but based on the error I'm guessing the application you were trying to start could not find one of dynamic libraries it depends on and probably reside in same folder. This is probably becouse upon calling the ShellExecute the CurenDir also known as WorkDir would be the one of your own application. But using TFileOpenDialog insted probably changes the CurentDir to the folder you are viewin in the TFileOpenDialog. Since I'm not at home I can't confirm ir deny this quess of mine. – SilverWarior Aug 08 '18 at 09:00
  • I understanded you, but if it's a problem in then component, why would it work on Delphi Xe7 and not in Tokyo? Thank you for your help. – Seeko Aug 08 '18 at 13:39