BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TOpenDialog and initial dir

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Andrew Smith
Guest





PostPosted: Fri Feb 17, 2006 4:03 am    Post subject: TOpenDialog and initial dir Reply with quote



Hi guys,

Got a TOpenDialog and am programatically setting the initial directory:

void __fastcall TfrmConfig::dlgOpenShow(TObject *Sender)
{
String strDir = getenv("DIRPATH");
if (DirectoryExists(strDir))
{
dlgOpen->InitialDir = strDir;
}
}

InitialDir gets set, but once executed the dialog does not open in the
specified directory. This is driving me nuts, any suggestions?

Cheers,

Andrew
Back to top
JD
Guest





PostPosted: Fri Feb 17, 2006 7:03 am    Post subject: Re: TOpenDialog and initial dir Reply with quote



"Andrew Smith" <nospamlaconical (AT) gmail (DOT) com> wrote:
Quote:

[...] InitialDir gets set, but once executed the dialog does
not open in the specified directory.

This has been discussed here many, many times in the past.

Quote:
This is driving me nuts,

Have you searched the archives?

http://www.tamaracka.com/search.htm

Quote:
any suggestions?

Have a look at it's Options property and ofNoChangeDir.

~ JD
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Feb 17, 2006 9:03 am    Post subject: Re: TOpenDialog and initial dir Reply with quote



"Andrew Smith" <nospamlaconical (AT) gmail (DOT) com> wrote in message
news:43f54263$2 (AT) newsgroups (DOT) borland.com...

Quote:
Got a TOpenDialog and am programatically setting the initial directory:

You are setting it in the wrong place. Setting it in the dialog's OnShow
event hs no effect. You have to set it before you call Execute(), ie:

void __fastcall TfrmConfig::btnClick(TObject *Sender)
{
String strDir = getenv("DIRPATH");

if( DirectoryExists(strDir) )
dlgOpen->InitialDir = strDir;
else
dlgOpen->InitialDir = "";

if (dlgOpen->Execute())
{
//...
}
}


Gambit
Back to top
Andrew Smith
Guest





PostPosted: Sun Feb 19, 2006 8:03 am    Post subject: Re: TOpenDialog and initial dir Reply with quote

Didn't even know that webiste existed, I'll have a look now, cheers

"JD" <nospam (AT) nospam (DOT) com> wrote in message
news:43f5635c$1 (AT) newsgroups (DOT) borland.com...
Quote:

"Andrew Smith" <nospamlaconical (AT) gmail (DOT) com> wrote:

[...] InitialDir gets set, but once executed the dialog does
not open in the specified directory.

This has been discussed here many, many times in the past.

This is driving me nuts,

Have you searched the archives?

http://www.tamaracka.com/search.htm

any suggestions?

Have a look at it's Options property and ofNoChangeDir.

~ JD
Back to top
Andrew Smith
Guest





PostPosted: Sun Feb 19, 2006 8:03 am    Post subject: Re: TOpenDialog and initial dir Reply with quote

Thanks Remy, that was certainly part of the problem

"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote in message
news:43f586e5$1 (AT) newsgroups (DOT) borland.com...
Quote:

"Andrew Smith" <nospamlaconical (AT) gmail (DOT) com> wrote in message
news:43f54263$2 (AT) newsgroups (DOT) borland.com...

Got a TOpenDialog and am programatically setting the initial directory:

You are setting it in the wrong place. Setting it in the dialog's OnShow
event hs no effect. You have to set it before you call Execute(), ie:

void __fastcall TfrmConfig::btnClick(TObject *Sender)
{
String strDir = getenv("DIRPATH");

if( DirectoryExists(strDir) )
dlgOpen->InitialDir = strDir;
else
dlgOpen->InitialDir = "";

if (dlgOpen->Execute())
{
//...
}
}


Gambit

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.