File access denied when printing from a Delphi application

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, everybody!

I'm getting the following error when I'm trying to print from a Delphi application:

File access denied.

This printer routine in my application is a routine to print text. So it prints to a file
in LPT1 . The source code is more or less like this:


Code:
procedure Print;
var
  File: TextFile;
begin
  AssignFile(File, 'LPT1');
  Rewrite(File);
  try
    Writeln(File, '...');
    // ...
  finally
    CloseFile(File);
  end;
end;



I think the error occur in the AssignFile or Rewrite procedures, when the application tries to generate the file that will hold the printing on the system. I'm almost sure that if I execute my application on Wine under root or superuser the printing will work, but we all know that we should not execute applications on Wine like that. So what's the solution to have file access in this case?

Thank you.

Marcos






[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux