Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetFileNameFromBrowse
Message
 
À
18/06/2010 19:12:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01469704
Message ID:
01469722
Vues:
50
>I`m trying to use this Api, but it doesn´t work... Any idea? Thanks.
>
>DECLARE INTEGER GetFileNameFromBrowse IN shell32;
> INTEGER hwnd,;
> STRING @ pszFilePath,;
> LONG cchFilePath,;
> STRING pszWorkingDir,;
> STRING pszDefExt,;
> STRING pszFilters,;
> STRING szTitle
>
>cFilename = SPACE(512) + CHR(0)
>nBufsize = 0
>cPath = "e:\ges24\"
>cExt= CHR(0)
>cFilter = CHR(0)
>cTitle = CHR(0)
>
>=GetFileNameFromBrowse(0, @cFilename, nBufsize,;
> cPath, cExt, cFilter, cTitle)

Your buffer should not be 0, but at least 250.
DECLARE INTEGER GetFileNameFromBrowse IN shell32;
INTEGER hwnd,;
STRING @ pszFilePath,;
LONG cchFilePath,;
STRING pszWorkingDir,;
STRING pszDefExt,;
STRING pszFilters,;
STRING szTitle

cFilename = SPACE(512) + CHR(0)
nBufsize = 250
cPath = "e:\ges24\"
cExt= CHR(0)
cFilter = CHR(0)
cTitle = CHR(0)

=GetFileNameFromBrowse(0, @cFilename, nBufsize,;
cPath, cExt, cFilter, cTitle) 
? cFileName
UPDATE: You may also want to look at the WideCharToMultiByte API. Because the filename and path that the above function returns has too many spaces in it.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform