AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi Text von Datei1 in Datei 2 anzeigen lassen
Thema durchsuchen
Ansicht
Themen-Optionen

Text von Datei1 in Datei 2 anzeigen lassen

Ein Thema von SyntaxXx · begonnen am 24. Apr 2010 · letzter Beitrag vom 24. Apr 2010
Antwort Antwort
SyntaxXx

Registriert seit: 14. Dez 2008
328 Beiträge
 
Delphi XE4 Architect
 
#1

Re: Text von Datei1 in Datei 2 anzeigen lassen

  Alt 24. Apr 2010, 11:54
Ok ich habe mich jetzt einw enig eingearbeitet doch hänge jetzt an einer stelle:

Ich möchte ja jetzt einen String in die Ressource eintragen.

Jetzt habe ichd ieses Beispiel gefunden.
Ist schon was älter.

Delphi-Quellcode:
HRSRC hResLoad; // handle to loaded resource
HANDLE hExe; // handle to existing .EXE file
HRSRC hRes; // handle/ptr. to res. info. in hExe
HANDLE hUpdateRes; // update resource handle
char *lpResLock; // pointer to resource data
BOOL result;
// Load the .EXE file that contains the dialog box you want to copy.
hExe = LoadLibrary("hand.exe");
if (hExe == NULL)
{
    ErrorHandler("Could not load exe.");
}
 
 
// Locate the dialog box resource in the .EXE file.
hRes = FindResource(hExe, "AboutBox", RT_DIALOG);
if (hRes == NULL)
{
    ErrorHandler("Could not locate dialog box.");
}
 
 
// Load the dialog box into global memory.
hResLoad = LoadResource(hExe, hRes);
if (hResLoad == NULL)
{
    ErrorHandler("Could not load dialog box.");
}
 
 
// Lock the dialog box into global memory.
lpResLock = LockResource(hResLoad);
if (lpResLock == NULL)
{
    ErrorHandler("Could not lock dialog box.");
}
 
 
// Open the file to which you want to add the dialog box resource.
hUpdateRes = BeginUpdateResource("foot.exe", FALSE);
if (hUpdateRes == NULL)
{
    ErrorHandler("Could not open file for writing.");
}
 
 
// Add the dialog box resource to the update list.
result = UpdateResource(hUpdateRes, // update resource handle
     RT_DIALOG, // change dialog box resource
     "AboutBox", // dialog box name
     MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), // neutral language
     lpResLock, // ptr to resource info
     SizeofResource(hExe, hRes)); // size of resource info.
if (result == FALSE)
{
    ErrorHandler("Could not add resource.");
}
 
 
// Write changes to FOOT.EXE and then close it.
if (!EndUpdateResource(hUpdateRes, FALSE))
{
    ErrorHandler("Could not write changes to file.");
}
 
 
// Clean up.
if (!FreeLibrary(hExe))
{
    ErrorHandler("Could not free executable.");
Aus folgendem Code schließe ich, das diese .exe als Ressource eingetrage wird:

hExe = LoadLibrary("hand.exe"); Ich möchte aber ja einen String eintragen.


Dann ahbe ich mal was gesucht und bin hierauf gestoßen:
http://www.delphipraxis.net/internal...ect.php?p=2269
Aber das funktioniert auch nicht wirklich.

Geht das nicht leichter?
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:31 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz