Getfile - Invalid path

Moderator: Rathinagiri

Post Reply
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Getfile - Invalid path

Post by Pablo César »

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)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Getfile - Invalid path

Post by danielmaximiliano »

Hola Pablo:
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
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Getfile - Invalid path

Post by Pablo César »

I do not understand, why I can not post my codes in this message. This is msg error when I try to submit it:
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.
I also tried to attach prg file but was not possible in this msg. Someone could tell me why ?
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
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Getfile - Invalid path

Post by l3whmg »

Hi Pablo,
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 ) )
and tell me if it's good for you?

Bye
Luigi from Italy
www.L3W.it
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Getfile - Invalid path

Post by Pablo César »

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.

Image
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
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Getfile - Invalid path

Post by l3whmg »

Hi Pablo, you're right, I'm sorry for misunderstanding :oops:

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
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Getfile - Invalid path

Post by Pablo César »

l3whmg wrote:I'm sorry for misunderstanding :oops:
Ops do not worry, collega.
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.
My prompt solution was to add this code in order to correct it by UDF:
Image
was not yet widespread or this problem has never been seen and verified
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.

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
Post Reply