Solved

OpenDialog.Filename problem

Posted on 1998-03-22
9
188 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Expert Comment

by:st_simon
Comment Utility
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
Comment Utility
st_simon: STOP HITTING SUBMIT!!
0
 

Expert Comment

by:lato
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now