Author | Topic: Folder Selection | |
---|---|---|
Carlos A Beling | Folder Selection on Tue, 29 Sep 2015 17:15:38 -0300 Good evening. Some time ago I found out the attached program in this NG for one to select a folder. I am trying to use it but it is giving an error. For compiling it is only to type xpp SaveFolder /b /link:/pm:pm Can someone correct it, if possible? Fraternally Beling SaveFolder.prg | |
Andreas Gehrs-Pahl | Re: Folder Selection on Wed, 30 Sep 2015 15:22:33 -0400 Carlos, >I am trying to use it but it is giving an error. This code is based on something that was originally posted by Steffen Rassek on 10/05/2001 (and again 11/22/2001) in the "public.xbase++.gui" News Group. Joe Carrick also posted this as his "MxBrowseForFolder" in various NGs, including: "public.xbase++.generic", on 06/23/2004, 09/26/2005, 08/26/2009, 03/09/2010, and in "public.xbase++.gui" on 07/20/2004, 01/11/2005. It was also re-posted in various, usually slightly modified and sometimes incomplete versions, by several other users, including Pascal Boivin on 01/09/2013 in the "public.xbase++.generic" NG, which is the code that you apparently used as your starting point. The following line of code is the reason for the IDSC that you are getting with your version: Line 52: BaStruct(aOFN, NIL) pidlRoot Changing that line to: Line 52: BaStruct(aOFN, 0) pidlRoot will fix the problem. The original code in Pascal's version was: Line 46: BaStruct(aOFN, NULL) pidlRoot But "NULL" wasn't #defined (as 0 [Zero]) anywhere in Steffen's or Pascal's versions, even though Joe's code usually included that define constant, so you apparently changed NULL to NIL instead of 0, which is the reason for the memory corruption that you will get with your code. Also, Günter Beyes has posted a more comprehensive version of this function, which doesn't use BAP and lets you (supposedly) even select a random start directory value other than NULL (or the CSIDL_* constants) for pidlRoot, so it might be superior to the other, BAP-based versions, even though this actually never worked for me. You can find this demo program in the GUI NG in a thread with a subject of: "Window api call", in a post that is dated: 01/11/2005. There is also an OT4Xb (demo) version available, which uses a callback and definitely lets you select a random directory as (pre-selected) root. It was posted by Pablo Botella on 03/10/2010 in the "public.xbase++.generic" NG in a thread with the subject: "FolderBrowse". Hope that helps, Andreas Andreas Gehrs-Pahl Absolute Software, LLC phone: (989) 723-9927 email: Andreas.GP@Charter.net web: http://www.Aerospace-History.net | |
Carlos A Beling | Re: Folder Selection on Fri, 02 Oct 2015 10:48:53 -0300 Good morning Andreas. Always brilliant. Many thanks. It worked fine, but I could not to set a folder to start. do you thing that using the activex below could to be best? https://msdn.microsoft.com/en-us/library/windows/desktop/bb774065(v=vs.85).aspx Many thanks again Fraternally Beling On 30/9/2015 16:22, Andreas Gehrs-Pahl wrote: > Carlos, > >> I am trying to use it but it is giving an error. > > This code is based on something that was originally posted by Steffen Rassek > on 10/05/2001 (and again 11/22/2001) in the "public.xbase++.gui" News Group. > > Joe Carrick also posted this as his "MxBrowseForFolder" in various NGs, > including: "public.xbase++.generic", on 06/23/2004, 09/26/2005, 08/26/2009, > 03/09/2010, and in "public.xbase++.gui" on 07/20/2004, 01/11/2005. > > It was also re-posted in various, usually slightly modified and sometimes > incomplete versions, by several other users, including Pascal Boivin on > 01/09/2013 in the "public.xbase++.generic" NG, which is the code that you > apparently used as your starting point. > > The following line of code is the reason for the IDSC that you are getting > with your version: > > Line 52: BaStruct(aOFN, NIL) pidlRoot > > Changing that line to: > > Line 52: BaStruct(aOFN, 0) pidlRoot > > will fix the problem. The original code in Pascal's version was: > > Line 46: BaStruct(aOFN, NULL) pidlRoot > > But "NULL" wasn't #defined (as 0 [Zero]) anywhere in Steffen's or Pascal's > versions, even though Joe's code usually included that define constant, so > you apparently changed NULL to NIL instead of 0, which is the reason for > the memory corruption that you will get with your code. > > Also, Günter Beyes has posted a more comprehensive version of this function, > which doesn't use BAP and lets you (supposedly) even select a random start > directory value other than NULL (or the CSIDL_* constants) for pidlRoot, so > it might be superior to the other, BAP-based versions, even though this > actually never worked for me. You can find this demo program in the GUI NG > in a thread with a subject of: "Window api call", in a post that is dated: > 01/11/2005. > > There is also an OT4Xb (demo) version available, which uses a callback and > definitely lets you select a random directory as (pre-selected) root. It was > posted by Pablo Botella on 03/10/2010 in the "public.xbase++.generic" NG in > a thread with the subject: "FolderBrowse". > > Hope that helps, > > Andreas > | |
Peter Alderliesten | Re: Folder Selection on Mon, 05 Oct 2015 13:15:59 +0200 Beling, Why not use XbpFolderDialog() ? XbpFolderDialog:Display(cRoot, @cFolder) Peter | |
Carlos A Beling | Re: Folder Selection on Tue, 06 Oct 2015 10:42:48 -0300 Hello Peter. Good morning. Many thanks. I have a Foundation subscription and I did not find XbpFolderDialog() in my help of Xbase++ 2.0. Could you please pointing to me the right place where I can find it? Fraternally Beling On 5/10/2015 08:15, Peter Alderliesten wrote: > Beling, > > Why not use XbpFolderDialog() ? > > XbpFolderDialog:Display(cRoot, @cFolder) > > Peter > | |
Igor Ferk | Re: Folder Selection on Fri, 09 Oct 2015 08:15:01 +0200 It is included in "Xbase Part Pack #3" from version 1.9. It's available on Alaska download center... (don't know if it's available with foundation subscr.) [SNIP of XbpFilderDialog.prg] ////////////////////////////////////////////////////////////////////// Copyright: Alaska Software, (c) 2011. All rights reserved. ////////////////////////////////////////////////////////////////////// /// Declaration of the "XbpFolderDialog" class ////////////////////////////////////////////////////////////////////// CLASS XbpFolderDialog FROM XbpSysWindow PROTECTED: VAR cTitle VAR lNewFolderButton VAR lEditBox VAR lURLs VAR lNetworkShares VAR lVirtualFolders VAR lUsageHint EXPORTED: METHOD Init() METHOD Create() METHOD Destroy() METHOD Configure() ACCESS METHOD GetTitle() VAR Title ASSIGN METHOD SetTitle() VAR Title ACCESS METHOD GetNewFolderButton() VAR NewFolderButton ASSIGN METHOD SetNewFolderButton() VAR NewFolderButton ACCESS METHOD GetEditBox() VAR EditBox ASSIGN METHOD SetEditBox() VAR EditBox ACCESS METHOD GetURLs() VAR URLs ASSIGN METHOD SetURLs() VAR URLs ACCESS METHOD GetNetworkShares() VAR NetworkShares ASSIGN METHOD SetNetworkShares() VAR NetworkShares ACCESS METHOD GetVirtualFolders() VAR VirtualFolders ASSIGN METHOD SetVirtualFolders() VAR VirtualFolders ACCESS METHOD GetUsageHint() VAR UsageHint ASSIGN METHOD SetUsageHint() VAR UsageHint METHOD Display() ENDCLASS [EOF SNIP] Regards, Igor Ferk "Carlos A Beling" je napisal v sporočilo news:3253a9a$2e79ccd$3c79e@news.alaska-software.com ... Hello Peter. Good morning. Many thanks. I have a Foundation subscription and I did not find XbpFolderDialog() in my help of Xbase++ 2.0. Could you please pointing to me the right place where I can find it? Fraternally Beling On 5/10/2015 08:15, Peter Alderliesten wrote: > Beling, > > Why not use XbpFolderDialog() ? > > XbpFolderDialog:Display(cRoot, @cFolder) > > Peter > Xpp3Info.png | |
Carlos A Beling | Re: Folder Selection on Wed, 21 Oct 2015 12:36:29 -0200 Hello Igor: good evening. Many thanks. I have the foundation subscription and I did not found it out.... Fraternally Beling On 9/10/2015 03:15, Igor Ferk wrote: > It is included in "Xbase Part Pack #3" from version 1.9. > It's available on Alaska download center... > (don't know if it's available with foundation subscr.) > > [SNIP of XbpFilderDialog.prg] > ////////////////////////////////////////////////////////////////////// > > Copyright: > Alaska Software, (c) 2011. All rights reserved. > > ////////////////////////////////////////////////////////////////////// > /// Declaration of the "XbpFolderDialog" class > ////////////////////////////////////////////////////////////////////// > CLASS XbpFolderDialog FROM XbpSysWindow > PROTECTED: > VAR cTitle > VAR lNewFolderButton > VAR lEditBox > VAR lURLs > VAR lNetworkShares > VAR lVirtualFolders > VAR lUsageHint > > EXPORTED: > METHOD Init() > METHOD Create() > METHOD Destroy() > METHOD Configure() > > ACCESS METHOD GetTitle() VAR Title > ASSIGN METHOD SetTitle() VAR Title > > ACCESS METHOD GetNewFolderButton() VAR NewFolderButton > ASSIGN METHOD SetNewFolderButton() VAR NewFolderButton > > ACCESS METHOD GetEditBox() VAR EditBox > ASSIGN METHOD SetEditBox() VAR EditBox > > ACCESS METHOD GetURLs() VAR URLs > ASSIGN METHOD SetURLs() VAR URLs > > ACCESS METHOD GetNetworkShares() VAR NetworkShares > ASSIGN METHOD SetNetworkShares() VAR NetworkShares > > ACCESS METHOD GetVirtualFolders() VAR VirtualFolders > ASSIGN METHOD SetVirtualFolders() VAR VirtualFolders > > ACCESS METHOD GetUsageHint() VAR UsageHint > ASSIGN METHOD SetUsageHint() VAR UsageHint > > METHOD Display() > ENDCLASS > [EOF SNIP] > > > Regards, > Igor Ferk > > "Carlos A Beling" je napisal v sporočilo > news:3253a9a$2e79ccd$3c79e@news.alaska-software.com ... > > Hello Peter. > Good morning. > Many thanks. > I have a Foundation subscription and I did not find XbpFolderDialog() in > my help of Xbase++ 2.0. Could you please pointing to me the right place > where I can find it? > Fraternally > Beling > > On 5/10/2015 08:15, Peter Alderliesten wrote: >> Beling, >> >> Why not use XbpFolderDialog() ? >> >> XbpFolderDialog:Display(cRoot, @cFolder) >> >> Peter >> | |
Carlos A Beling | Re: Folder Selection - New Post on Fri, 30 Oct 2015 16:22:15 -0200 Hello: good evening. I discovered the XbpFileDialog() in XbpPack3.zip in the ACSN section int the Alaska's site. I am playing with the Günter Beyes's FolderBrowseSample.prg from 11.01.2005 that makes folder selection for to learn how select a folder works. Later I think to try another solutions. The problem is that I am trying to start a root folder that has sub folders and the function gives an error message and does not let making the selection. It is only possible starting from the Desktop. Can someone show how to do accomplish this? I attached the program that I am using. Fraternally Beling On 21/10/2015 12:36, Carlos A Beling wrote: > Hello Igor: > good evening. > Many thanks. > I have the foundation subscription and I did not found it out.... > > Fraternally > Beling > > On 9/10/2015 03:15, Igor Ferk wrote: >> It is included in "Xbase Part Pack #3" from version 1.9. >> It's available on Alaska download center... >> (don't know if it's available with foundation subscr.) >> >> [SNIP of XbpFilderDialog.prg] >> ////////////////////////////////////////////////////////////////////// >> >> Copyright: >> Alaska Software, (c) 2011. All rights reserved. >> >> ////////////////////////////////////////////////////////////////////// >> /// Declaration of the "XbpFolderDialog" class >> ////////////////////////////////////////////////////////////////////// >> CLASS XbpFolderDialog FROM XbpSysWindow >> PROTECTED: >> VAR cTitle >> VAR lNewFolderButton >> VAR lEditBox >> VAR lURLs >> VAR lNetworkShares >> VAR lVirtualFolders >> VAR lUsageHint >> >> EXPORTED: >> METHOD Init() >> METHOD Create() >> METHOD Destroy() >> METHOD Configure() >> >> ACCESS METHOD GetTitle() VAR Title >> ASSIGN METHOD SetTitle() VAR Title >> >> ACCESS METHOD GetNewFolderButton() VAR NewFolderButton >> ASSIGN METHOD SetNewFolderButton() VAR NewFolderButton >> >> ACCESS METHOD GetEditBox() VAR EditBox >> ASSIGN METHOD SetEditBox() VAR EditBox >> >> ACCESS METHOD GetURLs() VAR URLs >> ASSIGN METHOD SetURLs() VAR URLs >> >> ACCESS METHOD GetNetworkShares() VAR NetworkShares >> ASSIGN METHOD SetNetworkShares() VAR NetworkShares >> >> ACCESS METHOD GetVirtualFolders() VAR VirtualFolders >> ASSIGN METHOD SetVirtualFolders() VAR VirtualFolders >> >> ACCESS METHOD GetUsageHint() VAR UsageHint >> ASSIGN METHOD SetUsageHint() VAR UsageHint >> >> METHOD Display() >> ENDCLASS >> [EOF SNIP] >> >> >> Regards, >> Igor Ferk >> >> "Carlos A Beling" je napisal v sporočilo >> news:3253a9a$2e79ccd$3c79e@news.alaska-software.com ... >> >> Hello Peter. >> Good morning. >> Many thanks. >> I have a Foundation subscription and I did not find XbpFolderDialog() in >> my help of Xbase++ 2.0. Could you please pointing to me the right place >> where I can find it? >> Fraternally >> Beling >> >> On 5/10/2015 08:15, Peter Alderliesten wrote: >>> Beling, >>> >>> Why not use XbpFolderDialog() ? >>> >>> XbpFolderDialog:Display(cRoot, @cFolder) >>> >>> Peter >>> FolderBrowse.zip | |
Clayton Jones | Re: Folder Selection - tdPathPick.jpg (0/1) on Mon, 12 Oct 2015 13:25:42 -0400 Hello Carlos, >Many thanks. It worked fine, but I could not to set a folder to start. > >do you thing that using the activex below could to be best? >https://msdn.microsoft.com/en-us/library/windows/desktop/bb774065(v=vs.85).aspx Top-Down Library has a tdPathPick() function that has a cStartPath parameter to specify the opening location. It uses a subclass of XbpTreeView and does all its work with Windows API calls, no BAP. It can also be used to create a new folder. It can be seen in action in the TD demo app which can be downloaded here http://cjcom.net/tddnload.htm Look for Dir Tree in the Components menu. In the screen shot below, the text in the window title bar is a parameter, so it can be changed. The button captions are defined constants in a .ch file, so they can also be changed. The display of the user's \Documents folder is an option. The window can be a Child or a Modal, with full color control. Regards, Clayton Clayton Jones www.cjcom.net Top-Down Library for Xbase++ X-DBU Database Utility X-MEMO Memo Field Replacement Spell-X Spell Checking for Xbase++ | |
Clayton Jones | Re: Folder Selection - tdPathPick.jpg (1/1) on Mon, 12 Oct 2015 13:25:43 -0400 | |
Carlos A Beling | Re: Folder Selection - tdPathPick.jpg (1/1) on Wed, 21 Oct 2015 12:37:48 -0200 Hello Clayton: good afternoon. Many thanks. I'll see it. Fraternally Beling On 12/10/2015 14:25, Clayton Jones wrote: | |
Werner Martl | Re: Folder Selection on Sun, 23 Oct 2016 17:06:14 +0200 Am 29.09.2015 um 22:15 schrieb Carlos A Beling: > Good evening. > > Some time ago I found out the attached program in this NG for one to > select a folder. > I am trying to use it but it is giving an error. > For compiling it is only to type xpp SaveFolder /b /link:/pm:pm > Can someone correct it, if possible? > > Fraternally > Beling Hello, ..\source\samples\apps\imgview has a DirSelector-Class. Best regards, Werner |