SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TsiBrowseForFolder - BrowseForComputer

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
Malcolm



Joined: 21 Jan 2003
Posts: 84
Location: Scotland

PostPosted: Fri Dec 26, 2003 3:02 pm    Post subject: TsiBrowseForFolder - BrowseForComputer Reply with quote

Hi

When setting siBrowseForFolder.Flags := [BrowseForComputer] and then selecting a computer, how does one access the selected 'computername'?

If this component does not do the buisness, does anyone know how else to get a computername?

Malcolm
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Sat Dec 27, 2003 7:03 am    Post subject: Reply with quote

I suppose it would be helpful to make small fix in SiDialog.Pas file in order to get this to work. Just insert at line #1207 the following:
Code:
    if FSelectedDir = '' then
      FSelectedDir := lpbi.pszDisplayName;


so the code will look like:
Code:
....
  try
    SelectedPIDL := SHBrowseForFolder(lpbi);
    if FSelectedDir = '' then
      FSelectedDir := lpbi.pszDisplayName;
  finally
    Result := SelectedPIDL <> nil;
....


And use SelectedDir property to obtain name of selected computer.
Back to top
View user's profile Send private message
Malcolm



Joined: 21 Jan 2003
Posts: 84
Location: Scotland

PostPosted: Sat Dec 27, 2003 9:39 am    Post subject: Reply with quote

Thanks, that works fine. Smile

Will that be in the next release, or will I need to remember to patch it?

Malcolm
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Sat Dec 27, 2003 3:39 pm    Post subject: Reply with quote

Of course this will be included in official release.
Back to top
View user's profile Send private message
Malcolm



Joined: 21 Jan 2003
Posts: 84
Location: Scotland

PostPosted: Tue Dec 30, 2003 9:16 am    Post subject: Reply with quote

There is a small problem with this patch.

Because SiDialog.pas does not clear FSelectedDir before the browse any subsequent [BrowseForComputer] call will return the result of the previous operation (FSelectedDir is not blank).

I am now clearing the .SelectedDir property in my code before making the call but I wonder whether SiDialog.pas can/should do this in this case?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Tue Dec 30, 2003 11:54 am    Post subject: Reply with quote

SelectedDir property is used to indicate which folder should be selected when calling Execute method, so the clearing/changing this property should be performed by application not dialog itself.
Back to top
View user's profile Send private message
Malcolm



Joined: 21 Jan 2003
Posts: 84
Location: Scotland

PostPosted: Tue Dec 30, 2003 12:54 pm    Post subject: Reply with quote

OK, noted, thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite 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 p h p B B  © 2001, 2005 p h p B B  Group