Page 2 of 2

Re: Getfolder()

Posted: Fri Apr 06, 2018 2:25 pm
by dominique_devuyst
Serge,

The folder path/name is ok (I have a multi language PC!).
I have tried C:\users\Administrateur\ and others folders not in Gebruiker : no problem.
Now, I see a padlock on Gebruiker.
However, I can read/write in the files and subfolders of the folder Gebruiker.
But the access seems blocked (only) for my application : strange!
I have tried to unlock Gebruiker in the properties, without result : it remains locked.
I continue to search for the why.

Dominique

Re: Getfolder()

Posted: Fri Apr 06, 2018 4:16 pm
by edk
Start application in "Run as Administrator" mode and check if you have access to this folder.

Re: Getfolder()

Posted: Tue Apr 10, 2018 10:43 am
by dominique_devuyst
edk wrote:
Fri Apr 06, 2018 4:16 pm
Start application in "Run as Administrator" mode and check if you have access to this folder.
Hi edk,

I have already tried : it is the same.
He return 'My computer' and not the initpath.

Dominique

Re: Getfolder()

Posted: Tue Apr 10, 2018 11:47 am
by edk
To which the user corresponds to the name "Gebruiker"? Will it be: Default, Default User, All Users, Public or is it called a local account in Windows?
What is the operating system?

Re: Getfolder()

Posted: Wed Apr 11, 2018 7:39 am
by dominique_devuyst
edk wrote:
Tue Apr 10, 2018 11:47 am
To which the user corresponds to the name "Gebruiker"? Will it be: Default, Default User, All Users, Public or is it called a local account in Windows?
What is the operating system?
Hi edk,

The OS is win7
The path is C:\Users\Gebruiker
The users are :
Capture_gebruiker1.JPG
Capture_gebruiker1.JPG (16.91 KiB) Viewed 157 times
Getfolder() returns the initpath for all folders (and subfolders) except for the folder Gebruiker and its contents.
I have tried to unlock Gebruiker (10 minuts!) but the padlock stay there.

Dominique

Re: Getfolder()

Posted: Wed Apr 11, 2018 10:23 am
by serge_girard
Strange. It must be a naming problem. Edward, what do you think?

Serge

Re: Getfolder()

Posted: Wed Apr 11, 2018 11:41 am
by esgici
serge_girard wrote:
Wed Apr 11, 2018 10:23 am
Strange ...
Could this "locked" symbol be pointing to something?
gebruiker.png
gebruiker.png (144.51 KiB) Viewed 142 times
Viva HMG :D

Re: Getfolder()

Posted: Wed Apr 11, 2018 2:22 pm
by edk
It seems to me that, the padlock is not the reason for this behavior of the GetFolder function here.

The C:\USER\Gebruiker folder is in this case a profile folder.

In order for GetFolder to work with this folder, it should be possible to display the profile folder in the window.

Try this code, it works on Windows 10 for me:

Code: Select all

#include "hmg.ch"
#define plik_ini "demo.ini"

PROCEDURE MAIN()
Local cPath:=""

BEGIN INI FILE (plik_ini) 
	GET cPath SECTION "Main" ENTRY "Path" DEFAULT ""
END INI

IF EMPTY(cPath)
	BEGIN INI FILE (plik_ini)
		SET SECTION "Main" ENTRY "Path" TO "C:\"
	END INI
ENDIF


DEFINE WINDOW main_form ;
	AT 110,220 ;
	WIDTH 335 ;
	HEIGHT 260 ;
	TITLE 'Test';
	MAIN; 
	NOMAXIMIZE ;
	NOSIZE
	
	DEFINE MAIN MENU
		DEFINE POPUP "&File"
			MENUITEM "&Get Folder" ACTION GetFld()
			MENUITEM "E&xit" ACTION Main_form.Release
		END POPUP
	END MENU
	
END WINDOW 

Main_form.center
Main_form.activate

RETURN

//--------------------------------------------------------------------

FUNCTION GetFld()
Local cPath:="" 
BEGIN INI FILE (plik_ini) 
	GET cPath SECTION "Main" ENTRY "Path" DEFAULT ""
END INI

msgbox('InitPath for GetFolder(): ' + cPath )

cPath :=  GetFolder ( 'Get Folder' , cPath, , .T. /* [<lNewFolderButton>] */, .T. /* [<lIncludeFiles>] */, CSIDL_DRIVES + CSIDL_PROFILE /* [<nCSIDL_FolderType>] */ )

IF EMPTY(cPath)
	RETURN Nil
ENDIF

msgbox('Selected Path by GetFolder(): ' + cPath)

BEGIN INI FILE (plik_ini)
	SET SECTION "Main" ENTRY "Path" TO cPath
END INI

RETURN
*****************************************************************

Re: Getfolder()

Posted: Wed Apr 11, 2018 2:30 pm
by andyglezl
Tal vez en Seguridad...
En la carpeta oprimir Boton derecho / Propiedades / Seguridad
------------------------------------------------------------------------------
Maybe in Security ...
In the folder, click Right button / Properties / Security
seguridad.png
seguridad.png (192.39 KiB) Viewed 128 times

Re: Getfolder()

Posted: Wed Apr 11, 2018 5:43 pm
by dominique_devuyst
edk wrote:
Wed Apr 11, 2018 2:22 pm
It seems to me that, the padlock is not the reason for this behavior of the GetFolder function here.

The C:\USER\Gebruiker folder is in this case a profile folder.

In order for GetFolder to work with this folder, it should be possible to display the profile folder in the window.

Try this code, it works on Windows 10 for me ......

Thanks edk,

Getfolder() with your parameters work very fine!
Good to know!

Thank you very much for your help.

Dominique