Autor Beitrag
Swordooo
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 119

W2K, Windows XP Professional
Delphi 2005 Personal, Delphi 7 Personal
BeitragVerfasst: Fr 22.08.08 21:42 
Hi an alle,
Da Ressourcen meine Freunde geworden sind, da man nicht den ganzen "Datei-Krempel" mich sich herumschleppen muss, habe ich eine bisher unbeantwortete Frage, oder eher gesagt zwei :lol: :
Welche "Dateitypen" gibt es in *.rc/*.res - Dateien alles? (Ich kann nur BITMAP und WAVE).
Könnte jemand mal eine Liste erstellen o.ä?!

Die andere Frage: Es gibt in Delphi ja eine Grundstrunktur : SaveToFile('Bla').
hier kann man jedoch meines wissen nicht *.res Dateien speichern / erstellen.

Gibt es eine Anweisung o.ä., womit man eine *.res Datei erstellen kann, die dann beim nächsten Programmstert i-wie verwendet wird? (mit SaveToFile kann man ja z.B. *.txt erstellen).

MfG Swordooo
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Fr 22.08.08 22:17 
BITMAP, SOUND, CURSOR, ANICURSOR, RCDATA, ICON, VIDEO, WAVE

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 22.08.08 22:48 
Wobei man zu RCDATA noch erwähnen sollte, dass man da alles reinpacken, Texte so wie auch binäre Dateien.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 23.08.08 02:01 
Mir fiel grad auf, dass ich bisher RC_DATA statts RCDATA verwendet habe, aber es trotzdem funktioniert hat. Gibt es da einen Unterschied oder läuft das auf das selbe hinaus :gruebel:

Da bin ich doch glatt zufällig auf eine Liste von Microsoft gestoßen:

ACCELERATORS
Defines menu accelerator keys.
BITMAP
Defines a bitmap by naming it and specifying the name of the file that contains it. (To use a particular bitmap, the application requests it by name.)
CURSOR
Defines a cursor or animated cursor by naming it and specifying the name of the file that contains it. (To use a particular cursor, the application requests it by name.)
DIALOG
Defines a template that an application can use to create dialog boxes.
DIALOGEX
Defines a template that an application can use to create dialog boxes.
FONT
Specifies the name of a file that contains a font.
HTML
Specifies an HTML file.
ICON
Defines an icon or animated icon by naming it and specifying the name of the file that contains it. (To use a particular icon, the application requests it by name.)
MENU
Defines the appearance and function of a menu.
MENUEX
Defines the appearance and function of a menu.
MESSAGETABLE
Defines a message table by naming it and specifying the name of the file that contains it. The file is a binary resource file generated by the message compiler.
POPUP
Defines a menu item that can contain menu items and submenus.
PLUGPLAY
Obsolete.
RCDATA
Defines data resources. Data resources let you include binary data in the executable file.
STRINGTABLE
Defines string resources. String resources are Unicode or ASCII strings that can be loaded from the executable file.
TEXTINCLUDE
A special resource that is interpreted by Visual C++. For more information, see TN035.
TYPELIB
A special resource that is used with the /TLBID and /TLBOUT linker options.
User-Defined Defines a resource that contains application-specific data.
VERSIONINFO
Defines a version-information resource. Contains information such as the version number, intended operating system, and so on.
VXD
Obsolete.


Warum ich die nie über Google gefunden habe wundert mich doch sehr :gruebel: (nur das Stichwort RCDATA hat die Seite geliefert :-|)

=> msdn.microsoft.com/e...aa381043(VS.85).aspx

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 23.08.08 16:05 
Sofern man nicht in einem Resourceneditor die Typen korrekt erkannt haben möchte, ist man nicht auf spezielle Typangaben angewiesen. Man muss beim Laden lediglich den selben Typ angeben. Beispiel:
ausblenden Resourcenskript
1:
Beispiel  DATEI  "Testdatei.txt"					

ausblenden Auslesen:
1:
  ResStream := TResourceStream.Create(HInstance, 'Beispiel''DATEI');					
Swordooo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 119

W2K, Windows XP Professional
Delphi 2005 Personal, Delphi 7 Personal
BeitragVerfasst: Sa 23.08.08 16:46 
Okay, danke.
Wie kann ich aber nun die Textdatei.txt auslesen und z.B. den 1. String im Label anzeigen lassen?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 23.08.08 17:15 
Habe ich doch schon geschrieben, einfach einen TResourceStream nehmen und diesen dann mit LoadFromStream benutzen, LoadFromStream gibts zum Beispiel auch bei TStringList.