Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Horrendous GETFILE replacement bug....
Message
De
23/06/2010 00:53:50
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01470173
Message ID:
01470273
Vues:
201
Hi Naomi,

It looks like the code below made it. It looks like a dependancy to shell32 is more robust than older stuff based on comdlg32.dll and msvcrt.dll even provided by MS.

LOCAL pszFilePath,cchFilePath,pszWorkingDir,pszDefExt,pszFilters,szTitle,cFileName

DECLARE INTEGER GetActiveWindow IN win32api

DECLARE INTEGER GetFileNameFromBrowse IN shell32;
INTEGER hwnd,;
STRING @ pszFilePath,;
LONG cchFilePath,;
STRING pszWorkingDir,;
STRING pszDefExt,;
STRING pszFilters,;
STRING szTitle

pszFilePath = REPLICATE(" ",512)+CHR(0)
cchFilePath = LEN(pszFilePath)
pszWorkingDir = STRCONV(myDirectory+CHR(0),5)
pszDefExt = STRCONV("csv"+CHR(0),5)
pszFilters = STRCONV("Text resources"+CHR(0)+"*.txt;*.csv"+CHR(0)+;
"fichiers MS Excel"+CHR(0)+"*.xls"+CHR(0)+CHR(0),5)
szTitle = STRCONV("Open resource"+CHR(0),5)

IF GetFileNameFromBrowse(THISFORM.Hwnd,@pszFilePath,cchFilePath,;
pszWorkingDir, pszDefExt, pszFilters, szTitle) = 0
RETURN
ENDIF

cFilename = STRCONV(pszFilePath,6) && unicode
cFilename = LEFT(cFilename,AT(CHR(0),cFilename)-1)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform