Hi,
FUNCTION MAIN() LOCAL cCurDir := GETCURRENTDIRECTORY() ? cCurDir ? SETCURRENTDIRECTORY( "C:\WINDOWS" ) ? SETCURRENTDIRECTORY( cCurDir ) ? SETCURRENTDIRECTORY( "C:" ) ? GETCURRENTDIRECTORY() INKEY( 0 ) RETURN NIL #pragma BEGINDUMP #include "windows.h" #include "hbapi.h" HB_FUNC( SETCURRENTDIRECTORY ) { hb_retl( SetCurrentDirectory( hb_parc( 1 ) ) ); } HB_FUNC( GETCURRENTDIRECTORY ) { char szPath[ MAX_PATH ]; if( GetCurrentDirectory( MAX_PATH, szPath ) ) hb_retc( szPath ); } #pragma ENDDUMP Same result: E:\HARBOUR T. T. T. C:\ EMG
I have different results (WinXP SP2)! SetCurrentDirectory("C:") correctly sets C drive and its current directory.
====================================================== PROC main() TEST() RETURN #pragma BEGINDUMP #include "windows.h" HB_FUNC( TEST ) { char szPath[ MAX_PATH ]; printf( "%d\n", GetCurrentDirectory( MAX_PATH, szPath ) ); printf( "%s\n", szPath ); printf( "%d\n", SetCurrentDirectory( "D:\PRG" ) ); printf( "%d\n", GetCurrentDirectory( MAX_PATH, szPath ) ); printf( "%s\n", szPath ); printf( "%d\n", SetCurrentDirectory( "C:" ) ); printf( "%d\n", GetCurrentDirectory( MAX_PATH, szPath ) ); printf( "%s\n", szPath ); } #pragma enddump ====================================================== C:\cawi32\sample\test>test147 21 C:\cawi32\sample\test 1 6 D:\PRG 1 21 C:\cawi32\sample\test ====================================================== Regards, Mindaugas _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour