Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

OpenDialog.Filename problem

Posted on 1998-03-22
9
Medium Priority
?
217 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
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

783 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