El Loco wrote:
Buenos días Karinha
Proba después de
cFile := cGetFile( "ImageFile(.bmp;.jpg;.jpeg;.png)|.bmp;.jpg;.jpeg;.png|", ;
"Selecione um Arquivo Para Gravar", CurDir(), .T. )
poner:
DirChange(cDirExe) o
ft_ChDir(cDirExe) esta funcion hace lo mismo que DirChange()
Saludos
Ni por Jesus!! jajajajajaja.
// C:\FWH\SAMPLES\cGetLoco.prg - 11/09/2026 - Kapiaba.
#include "FiveWin.ch"
#Include "Directry.ch"
FUNCTION Main()
LOCAL cDirExe := GETCURDIR()
LOCAL cNewDir := cDirExe // "C:\MyFolder"
LOCAL nResult, cFile
IF SUBS( cDirExe, LEN( ALLTRIM(cDirExe ) ) , 1 ) = "\"
cDirExe := SUBS( cDirExe, 1 , LEN( ALLTRIM(cDirExe ) ) - 1 )
ENDIF
nResult := DirChange( cNewDir ) // LCHDIR( cDirExe )
IF nResult == 0
MsgInfo( "Directory changed successfully to: " + cNewDir )
ELSE
MsgStop( "Error: Could not change directory. Check if the path exists." )
ENDIF
// NO FUNCIONA.
cFile := cGetFile( "ImageFile(*.bmp;*.jpg;*.jpeg;*.png)|*.bmp;*.jpg;*.jpeg;*.png|", ;
"Selecione um Arquivo Para Gravar", CurDir(), .T. )
// TAMBIEN NO FUNCIONA.
/*
cFile := cGetFile( "ImageFile(*.bmp;*.jpg;*.jpeg;*.png)|*.bmp;*.jpg;*.jpeg;*.png|", ;
"Selecione um Arquivo Para Gravar", 1, cNewDir, .T. )
*/
IF .NOT. EMPTY( cFile )
xIMAGE( cFile )
ENDIF
// No tiene sentido, ya que al entrar de nuevo en la función, ya estoy en la
// CARPETA DE ORIGEN.
DirChange( cDirExe ) // NO FUNCIONA
// NO FUNCIONA - FALTA ALGO? HBNF.LIB? NO TENGO.
// ft_ChDir(cDirExe) // esta funcion hace lo mismo que DirChange()
// Error: Unresolved external '_HB_FUN_FT_CHDIR' HARBOUR y XHARBOUR.
/*
IF FT_CHDIR( cDirExe ) == 0
? "Diretório alterado com sucesso!"
ELSE
? "Erro ao mudar de diretório."
ENDIF
*/
/*
Dica de modernização: No Harbour moderno, você também pode substituir
o uso da FT_CHDIR() diretamente pela função nativa DirChange() ou
hb_DirChange(), eliminando a necessidade de depender dessa biblioteca
externa.
*/
RETURN NIL
// FIN / END - kapiabafwh@gmail.com
Regards, saludos.