Solved

OpenDialog.Filename problem

Posted on 1998-03-22
9
201 Views
Last Modified: 2010-04-06
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....

0
Comment
Question by:sergio_2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1360698
Hi

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
0
 

Expert Comment

by:st_simon
ID: 1360699
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...


0
 

Expert Comment

by:st_simon
ID: 1360700
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...


0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:st_simon
ID: 1360701
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...


0
 

Expert Comment

by:st_simon
ID: 1360702
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...


0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1360703
st_simon: STOP HITTING SUBMIT!!
0
 

Expert Comment

by:lato
ID: 1360704
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.
0
 
LVL 4

Accepted Solution

by:
BoRiS earned 10 total points
ID: 1360705
make sure you did not type M=/yy.l in the filename section of your opendialog option under the object inspector...

If the filename field is blank then showmessage should be blank....

If you are executing the opendialog and then showing the message then there is something wrong on that machine maybe the FAT structure are stuffed or something...

Later

BoRiS
0
 

Author Comment

by:sergio_2001
ID: 1360706
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(Sender: 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....
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Why can't I create any project with my delphi EXE file? 6 58
Microsoft Access 97 and Delphi XE2 9 85
shape, triangle, dbctrlgrid 3 46
Delphi, TImage, Png 2 55
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question