Allgemeine Fragen zur PROFAN Programmierung
Views (Heute): 242889 (4325)
  Suchen
 Zurück zur Übersicht
 AutorThema: @FindFirst$
Thomas Ungerböck
Datum:24.06.02 21:05 Antwortenals Email verschicken (Kerzenlicht@chello.at) 


Hallo,
Bin gerade dabei einen Bildbetrachter zu schreiben. Habe Fotoserien wo die Dateinamen gleich sind nur am Ende die Nummer ändert sich. Ist mir beim Testen meines Programmes aufgefallen, daß z.B. das 13te Bild vor dem 12ten angezeigt wird. In meinen Grafikanwendungen wirds in der richtigen Reihenfolge angezeigt (sowie in anderen auch).
Jetzt hab ich mir die Eigenschaften der Bilder noch mal genauer angesehen.
Bild 13 hat ein früheres Erstelldatum als Bild 12.
Die Bilder werden eingelesen mit @FindFirst$ @Findnext. Eigentlich hab ich mir gedacht, das @FindFirst$ nach Dateinamen aufwärtssortierend einlesen tut.
Vielleicht hat da schon wer damit Erfahrungen gemacht.
Verwende WinMe, Profan 7,5 und bei den Bildern handelt es sich um Jpg (ProSpeed.Dll), die Schreibweise hab ich auch kontrolliert, es passt alles.
Gruß Thomas


Sven Schmidts
Datum:25.06.02 08:37 Antwortenals Email verschicken (schmidts@flat2serv.de) 


FindFirst basiert auf der gleichnamigen Windows-API, daher an dieser Stelle ein Auszug aus der Hilfe. Ich denke, Du musst die Liste der Dateinamen nach dem Einlesen sortieren, so würde ich es jedenfalls lösen. U.U. möchte der Anwender ja nach Datum, nach Name, nach Größe o.ä. anzeigen?

Mfg.
Sven Schmidts

"
The FindFirstFile function searches a directory for a file whose name matches the specified filename. FindFirstFile examines subdirectory names as well as filenames.

HANDLE FindFirstFile(

LPCTSTR lpFileName, // pointer to name of file to search for
LPWIN32_FIND_DATA lpFindFileData // pointer to returned information
);


Parameters

lpFileName

Windows 95: Points to a null-terminated string that specifies a valid directory or path and filename, which can contain wildcard characters (* and ?). This string must not exceed MAX_PATH characters.
Windows NT: Points to a null-terminated string that specifies a valid directory or path and filename, which can contain wildcard characters (* and ?).
There is a default string size limit for paths of MAX_PATH characters. This limit is related to how the FindFirstFile function parses paths. An application can transcend this limit and send in paths longer than MAX_PATH characters by calling the wide (W) version of FindFirstFile and prepending "\\?\" to the path. The "\\?\" tells the function to turn off path parsing; it lets paths longer than MAX_PATH be used with FindFirstFileW
. This also works with UNC names. The "\\?\" is ignored as part of the path. For example, "\\?\C:\myworld\private" is seen as "C:\myworld\private", and "
\\?\UNC\bill_g_1\hotstuff\coolapps" is seen as "\\bill_g_1\hotstuff\coolapps".

lpFindFileData

Points to the WIN32_FIND_DATA structure that receives information about the found file or subdirectory. The structure can be used in subsequent calls to the FindNextFile or FindClose function to refer to the file or subdirectory.



Return Values

If the function succeeds, the return value is a search handle used in a subsequent call to FindNextFile or FindClose.
If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.

Remarks

The FindFirstFile function opens a search handle and returns information about the first file whose name matches the specified pattern. Once the search handle is established, you can use the FindNextFile function to search for other files that match the same pattern. When the search handle is no longer needed, close it by using the FindClose function.
This function searches for files by name only; it cannot be used for attribute-based searches.
"


René Wagner
Datum:25.06.02 12:30 Antwortenals Email verschicken (apollo@rw-net.de) 


@Thomas
Ich weiss ja nicht genau, wie Du das FindFirst/FindNext verwendest.
Eventuell bietet es sich ja auch an, die gesamten Dateien mittels AddFiles in ne Listbox zu schmeissen und dann durch diese zu laufen. :)

mfG, René


Thomas Ungerböck
Datum:25.06.02 19:12 Antwortenals Email verschicken (Kerzenlicht@chello.at) 


An eine Listbox hab ich auch schon gedacht. Mich hat das halt nur gewundert, ist mir noch nie vorher aufgefallen. Hab noch den Dateinamen umgeändert, sodas die Bilder nurmer 13.jpg und 12.jpg heissen, ist wieder das selbe.
Gruß Thomas.


Sven Schmidts
Datum: 26.06.02 08:26 Antwortenals Email verschicken (schmidts@flat2serv.de) 


Hallo,

dann sammel doch alle Dateinamen in eine LB, schaufel dann alle um in ein Array und speichere dazu, je nach Datei, Datum, Größe usw. Dann kannst Du beliebig sortieren.

Mfg.
Sven Schmidts


 Zurück zur Übersicht