sergio_2001
asked on
OpenDialog.Filename problem
When I try to get one file name using OpenDialog.filename it returns some garbage...
Example: ShowMessage('File name is '+ OpenDialog1.filename);
It returns something like this: File name is M=/yy.l { <<== ????}
Regards....
Example: ShowMessage('File name is '+ OpenDialog1.filename);
It returns something like this: File name is M=/yy.l { <<== ????}
Regards....
I tried it but it works fine. (if you free it you got an exeption...)
Maybe you have to execute it first if you want some info from it.
opendialog.execute;
Maybe something in your system environment wrong...
Maybe you mistype something...
Maybe you have to execute it first if you want some info from it.
opendialog.execute;
Maybe something in your system environment wrong...
Maybe you mistype something...
I tried it but it works fine. (if you free it you got an exeption...)
Maybe you have to execute it first if you want some info from it.
opendialog.execute;
Maybe something in your system environment wrong...
Maybe you mistype something...
Maybe you have to execute it first if you want some info from it.
opendialog.execute;
Maybe something in your system environment wrong...
Maybe you mistype something...
I tried it but it works fine. (if you free it you got an exeption...)
Maybe you have to execute it first if you want some info from it.
opendialog.execute;
Maybe something in your system environment wrong...
Maybe you mistype something...
Maybe you have to execute it first if you want some info from it.
opendialog.execute;
Maybe something in your system environment wrong...
Maybe you mistype something...
I tried it but it works fine. (if you free it you got an exeption...)
Maybe you have to execute it first if you want some info from it.
opendialog.execute;
Maybe something in your system environment wrong...
Maybe you mistype something...
Maybe you have to execute it first if you want some info from it.
opendialog.execute;
Maybe something in your system environment wrong...
Maybe you mistype something...
st_simon: STOP HITTING SUBMIT!!
Try storing the whole string into an array of char before doing the showmessage. If you're using the application.ShowMessage, it uses a PChar, not a String, and Delphi 2.x, 3.x sometimes do weird things with strings and pchar's conversions.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi all,
- The filename property is blank...
- I don't think that it's free before... It fails in new projects....
- I execute it first using:
procedure TMemoPadForm.Open1Click(Se nder: TObject);
begin
OpenDialog1.execute;
end;
- I don't know how I'll use pchar instead string with showmessage...
- I suspect it's one environment bug too....
- I'll look the fat...
Please send your comments....
Thanks....
- The filename property is blank...
- I don't think that it's free before... It fails in new projects....
- I execute it first using:
procedure TMemoPadForm.Open1Click(Se
begin
OpenDialog1.execute;
end;
- I don't know how I'll use pchar instead string with showmessage...
- I suspect it's one environment bug too....
- I'll look the fat...
Please send your comments....
Thanks....
That is very strange. I have never had that problem before. Is OpenDialog1 a component on your form? Did you accidently free it somewhere?
JB