BlackBoard (http://www.black-board.net/index.php)
- Design, Programmierung & Entwicklung (http://www.black-board.net/board.php?boardid=55)
-- Programmieren (http://www.black-board.net/board.php?boardid=4)
--- UpdateResource() - Funktion (http://www.black-board.net/thread.php?threadid=13146)


Geschrieben von Medusa am 28.07.2003 um 15:44:

  UpdateResource() - Funktion

Hi,
Ich will die Resourcen eines exe-files ändern. Genauer gesagt das Icon. Was da nun reingeschrieben wird, is jetzt mal egal, es is grad "blabla".
Das Problem ist erstmal, dass da gar nix geht, weil die Funktion BeginUpdateResource() Null zurück gibt. Die Datei existiert und is eine win32-exe. (Id vom icon ist "icon")
code:
1:
2:
3:
Handle = BeginUpdateResource("C:\windows\desktop\test.exe", false)
Call UpdateResource(Handle, 3, "icon", 7, "blabla", 6)
Call EndUpdateResource(Handle, False)


Es ist VB, was aber eigentlich net viel zur Sache tut.
Wenn doch, dann kann ich noch sagen, dass die Funktionen korrekt deklariert wurden:
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Private Declare Function UpdateResource Lib "kernel32.dll" Alias "UpdateResourceA" _
 (ByVal hUpdate As Long, ByVal lpType As String, ByVal lpName As String, _
 ByVal wLanguage As Long, lpData As Any, ByVal cbData As Long) _
 As Long
 
Private Declare Function BeginUpdateResource Lib "kernel32.dll" Alias "BeginUpdateResourceA" _
 (ByVal pFileName As String, ByVal bDeleteExistingResources As Long) _
 As Long
 
Private Declare Function EndUpdateResource Lib "kernel32.dll" Alias "EndUpdateResourceA" _
 (ByVal hUpdate As Long, ByVal fDiscard As Long) _
 As Long


Kann mir jemand helfen? unglücklich
- Ich hab Win98 -

Danke !!! smile



<edit>
GetLastError gibt mir den Fehlercode 120 zurück. "Application-defined or object-defined error". Kein Plan was, warum, woher!?
</edit>

<nommal_edit>
Ich les grad in der Msdn:
Minimum operating systems Windows NT 3.1
Unicode Implemented as Unicode and ANSI versions on Windows NT, Windows 2000, Windows XP
böse
Aber dann frag ich mich, warums die Funktion bei meim 98er gibt!? unglücklich
Komisch...
Falls doch noch jemand was dazu einfällt --> posten Augenzwinkern
</nommal_edit>


Forensoftware: Burning Board 2.3.6, entwickelt von WoltLab GmbH