Recent

Author Topic: Convert Errors Delphi -> Lazarus  (Read 13322 times)

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: Convert Errors Delphi -> Lazarus
« Reply #60 on: September 18, 2019, 08:11:56 am »
Sorry but i have to use PChar here:

GetFileAttributesEx(PChar(FileName), GetFileExInfoStandard, @fad)

Following is only to test if the data is given correctly:

ShowMessage(String(PChar(FileName))); 

I understand that the system can't find the file when the file/path is not given correctly when using PChar here. So what i am doing wrong here in Lazaraus?

Code: Pascal  [Select][+][-]
  1. ShowMessage(String(PChar(FileName)));

You don't need the conversion here.

Moombas

  • New Member
  • *
  • Posts: 38
Re: Convert Errors Delphi -> Lazarus
« Reply #61 on: September 18, 2019, 08:40:30 am »
Sorry but i have to use PChar here:

GetFileAttributesEx(PChar(FileName), GetFileExInfoStandard, @fad)

Following is only to test if the data is given correctly:

ShowMessage(String(PChar(FileName))); 

I understand that the system can't find the file when the file/path is not given correctly when using PChar here. So what i am doing wrong here in Lazaraus?

Code: Pascal  [Select][+][-]
  1. ShowMessage(String(PChar(FileName)));

You don't need the conversion here.

Please read completely:

Following is only to test if the data is given correctly:

ShowMessage(String(PChar(FileName))); 

I solved this problem by this:

GetFileAttributesEx(PChar(String(FileName)), GetFileExInfoStandard, @fad)
« Last Edit: September 18, 2019, 08:42:17 am by Moombas »
The path is the destination but you should never lose sight of the destination on the way.

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: Convert Errors Delphi -> Lazarus
« Reply #62 on: September 18, 2019, 08:51:40 am »
Sorry but i have to use PChar here:

GetFileAttributesEx(PChar(FileName), GetFileExInfoStandard, @fad)

Following is only to test if the data is given correctly:

ShowMessage(String(PChar(FileName))); 

I understand that the system can't find the file when the file/path is not given correctly when using PChar here. So what i am doing wrong here in Lazaraus?

Code: Pascal  [Select][+][-]
  1. ShowMessage(String(PChar(FileName)));

You don't need the conversion here.

Please read completely:

Following is only to test if the data is given correctly:

ShowMessage(String(PChar(FileName))); 

I solved this problem by this:

GetFileAttributesEx(PChar(String(FileName)), GetFileExInfoStandard, @fad)

Okay then. Have it you way. O:-)

 

TinyPortal © 2005-2018