Page 1 of 1

FtpCreateDirectory ?

Posted: Tue Nov 11, 2008 6:16 pm
by Ale SB
No es possible usar FtpCreateDirectory com fwPPc ?

estoy hacendo asi, y no esta criando el directory :

Code: Select all

FtpCreateDirectory( oBjIn:hFTP, "/public_html/Paste_1/NewPaste" )

Code: Select all

#pragma BEGINDUMP

#include "windows.h"
#include "wininet.h"
#include "hbapi.

HB_FUNC( FTPCREATEDIRECTORY )
{
    hb_retl( FtpCreateDirectory( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) );
}
#pragma ENDDUMP
Saluds, Ale

Posted: Sat Nov 15, 2008 1:12 am
by Antonio Linares
Ale,

Windows Mobile usa unicode, por lo que tienes que pasar esa cadena de ansi a unicode:

Code: Select all

#pragma BEGINDUMP

#include "windows.h"
#include "wininet.h"
#include "hbapi.h"

WCHAR * AnsiToWide( char * );

HB_FUNC( FTPCREATEDIRECTORY )
{
    WCHAR * pW = AnsiToWide( hb_parc( 2 ) );

    hb_retl( FtpCreateDirectory( ( HINTERNET ) hb_parnl( 1 ), pW ) );
    hb_xfree( pW );
}
#pragma ENDDUMP