When we are selecting files by "My Network Places", Getfile() brings a wrong path os files.
For example: "\\pc\c\system\clientes.dbf" then GetFile() resturns "\pc\c\system\clientes.dbf"
(Please note only one red bar in place of two bars)
Which it causes breakdown of system.
But if I choose thru "My Computer" and the I choose a Drive+Path, the it´s works perfectally.
I´m using HMG version 3.0.35 (2010.06.20)
Getfile - Invalid path
Moderator: Rathinagiri
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Getfile - Invalid path
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Getfile - Invalid path
Hola Pablo:
puedes postear el ejemplo.prg para probarlo?
uso direccione absolutas para traer archivos por la red.
Saludos
DaNiElMaXiMiLiAnO
puedes postear el ejemplo.prg para probarlo?
uso direccione absolutas para traer archivos por la red.
Saludos
DaNiElMaXiMiLiAnO
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: Getfile - Invalid path
I do not understand, why I can not post my codes in this message. This is msg error when I try to submit it:
By other hand, I uploaded at: Click here to download Main.Prg
I also tried to attach prg file but was not possible in this msg. Someone could tell me why ?Not Acceptable
An appropriate representation of the requested resource /posting.php could not be found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
By other hand, I uploaded at: Click here to download Main.Prg
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: Getfile - Invalid path
Hi Pablo,
please can you try this piece of code:
and tell me if it's good for you?
Bye
please can you try this piece of code:
Code: Select all
f := Getfile ( { {'All DBFs','*.dbf'},{"All files","*.*"} } , 'Select files' , GetCurrentFolder() , .f. , .t. )
MSGSTOP( HB_VALTOEXP( f ) )
Bye
Luigi from Italy
www.L3W.it
www.L3W.it
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Getfile - Invalid path
Grazie caro collega Luigi per la risposta ! (non so scrivere niente in Italiano: better in English...)
I noted the only difference in your suggestion is in 4th parameter (lMultiSelect) to be setted with boolean false that makes difference because it returns with double bar "\\" at begining of string. But I am needing to make multi dbf files, so I need 4th param with boolean true. Such parameters the returns of GetFile() are different. When 4th param is false returns a variable type character and when 4th param is true returns a array type (what in my opinion should be always an array return, not as character variable)
So my understanding is when 4th param is true files choosen by "My Network Places" is returning an array containing only one bar at begining in each elements. Fo that reason I believe that is a HMG GetFile() BUG.
However I could correct this problem treating in cPath variable adding a extra bar when is starting with only one bar.
I have compiled with HMG version 3.0.35 and with also HMG version 4 but this problem does not appear in version 4. Because in version 4 there is not a option to search file in "My Network Places" button. There are mapeaded net units, then it works in both versions.
At least an image better than words...
I noted the only difference in your suggestion is in 4th parameter (lMultiSelect) to be setted with boolean false that makes difference because it returns with double bar "\\" at begining of string. But I am needing to make multi dbf files, so I need 4th param with boolean true. Such parameters the returns of GetFile() are different. When 4th param is false returns a variable type character and when 4th param is true returns a array type (what in my opinion should be always an array return, not as character variable)
So my understanding is when 4th param is true files choosen by "My Network Places" is returning an array containing only one bar at begining in each elements. Fo that reason I believe that is a HMG GetFile() BUG.
However I could correct this problem treating in cPath variable adding a extra bar when is starting with only one bar.
I have compiled with HMG version 3.0.35 and with also HMG version 4 but this problem does not appear in version 4. Because in version 4 there is not a option to search file in "My Network Places" button. There are mapeaded net units, then it works in both versions.
At least an image better than words...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: Getfile - Invalid path
Hi Pablo, you're right, I'm sorry for misunderstanding
I think it would be necessary to revise the low-level C code.
Probably the problem is the Windows API (GetOpenFileName); on the internet there are hacks to solve this problem. I think this routine was written when the UNC path format was not yet widespread or this problem has never been seen and verified.
I think the immediate solution is to map a drive (I knoe it's not practical these days) and the second one rewrite C low-level code.
Best regards
I think it would be necessary to revise the low-level C code.
Probably the problem is the Windows API (GetOpenFileName); on the internet there are hacks to solve this problem. I think this routine was written when the UNC path format was not yet widespread or this problem has never been seen and verified.
I think the immediate solution is to map a drive (I knoe it's not practical these days) and the second one rewrite C low-level code.
Best regards
Luigi from Italy
www.L3W.it
www.L3W.it
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Getfile - Invalid path
Ops do not worry, collega.l3whmg wrote:I'm sorry for misunderstanding
My prompt solution was to add this code in order to correct it by UDF:I think the immediate solution is to map a drive (I knoe it's not practical these days) and the second one rewrite C low-level code.
You are probably right dear Luigi and for this reason I posted here just to be registered. In version 4 there is not this problem because there is the option to search in "My Network Places" only by mapeaded drives.was not yet widespread or this problem has never been seen and verified
P.S. Please Administrators and Global moderators, please note that I am not able to post (code)(/code), could you explain what is happing ??
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein