cs_pichu
Messages postés28Date d'inscriptiondimanche 9 mars 2003StatutMembreDernière intervention 8 juin 2005
-
16 avril 2003 à 17:38
ManTico
Messages postés11Date d'inscriptionmercredi 20 août 2003StatutMembreDernière intervention21 juillet 2005
-
24 mars 2006 à 15:16
Dans une CFileDialog on est limité dans le nombre de selection si on en selectionne plusieurs
le pb est que je veux etre illimite dans le nombre
Comment je peux faire car la doc dit "The buffer should be at least 256 characters long". Auriez vous une astuce svp??
merci
cs_pichu
Messages postés28Date d'inscriptiondimanche 9 mars 2003StatutMembreDernière intervention 8 juin 2005 17 avril 2003 à 08:49
je me suis tronpé de phrase (j'ai pris un trop court extrait qui n'avais rien a voir dsl)
c'était :
"
lpstrFile
Pointer to a buffer that contains a filename used to initialize the File Name edit control. The first character of this buffer must be NULL if initialization is not necessary. When the GetOpenFileName or GetSaveFileName function returns successfully, this buffer contains the drive designator, path, filename, and extension of the selected file.
If the OFN_ALLOWMULTISELECT flag is set and the user selects multiple files, the buffer contains the current directory followed by the filenames of the selected files. For Explorer-style dialog boxes, the directory and filename strings are NULL separated, with an extra NULL character after the last filename. For old-style dialog boxes, the strings are space separated and the function uses short filenames for filenames with spaces. You can use theFindFirstFile function to convert between long and short filenames.
If the buffer is too small, the function returns FALSE and the CommDlgExtendedError function returns FNERR_BUFFERTOOSMALL. In this case, the first two bytes of the lpstrFile buffer contain the required size, in bytes or characters.
nMaxFile
Specifies the size, in bytes (ANSI version) or 16-bit characters (Unicode version), of the buffer pointed to by lpstrFile. The GetOpenFileName and GetSaveFileName functions return FALSE if the buffer is too small to contain the file information. The buffer should be at least 256 characters long. "
mais ils ne disent pas comment allouer un buffer plus grand
j'ai essaye de comprnedre ca :
"To allow the user to select multiple files, set the OFN_ALLOWMULTISELECT flag before calling DoModal. You need to supply your own filename buffer to accommodate the returned list of multiple filenames. Do this by replacing m_ofn.lpstrFile with a pointer to a buffer you have allocated, after constructing the CFileDialog, but before calling DoModal. Additionally, you must set m_ofn.nMaxFile with the number of characters in the buffer pointed to by m_ofn.lpstrFile."
mais j'arrive pas en faisant
LPTSTR buf;
CFileDialog fd(....)
fd.m_ofn.lpstrFile= buf;
fd.m_ofn..nMaxFile =1000;
ca plante...
la je pense avoir tout dit sur mon pb...
merci