Click here to Skip to main content
15,914,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFind Replace Problem MSWord 200 from C++ Pin
Neil Katalino30-May-00 17:09
Neil Katalino30-May-00 17:09 
QuestionToolbar-like Framework? Pin
Sid Price30-May-00 11:43
Sid Price30-May-00 11:43 
AnswerRe: Toolbar-like Framework? Pin
Dmitriy31-May-00 4:56
Dmitriy31-May-00 4:56 
Generalupdateresource question Pin
drkar30-May-00 11:09
drkar30-May-00 11:09 
GeneralRe: updateresource question Pin
Paolo Messina30-May-00 11:36
professionalPaolo Messina30-May-00 11:36 
GeneralRe: updateresource question Pin
Dmitriy31-May-00 4:54
Dmitriy31-May-00 4:54 
GeneralRe: updateresource question Pin
Blake Miller9-Jun-00 21:58
Blake Miller9-Jun-00 21:58 
GeneralRe: updateresource question Pin
Blake Miller5-Jun-00 4:40
Blake Miller5-Jun-00 4:40 
I figured it out!

You MUST free the library prior to using the BeginUpdateResource, UpdateResource, EndUpdateResource sequence.

Even though update always truly failed when library was loaded in memory, no errors were indicated or returned!

Here is pseudo-code sequence...

LoadLibraryEx <- no need to execute dll entry point
FindResourceEx
LoadResource
LockResource <- gets pointer to data
SizeofResource <- how much data you got
...allocate memory to hold modifiable copy of resource data
...make copy of resource data into memory block
FreeLibrary <- important to do it here

BeginUpdateResource
...modify resource data, or supply new data if you want
UpdateResource
EndUpdateResource

...deallocate memory you obtained earlier


That's it!

As a test, I was able to modify the fixed file version information (dwFileVersionMS and dwFileVersionLS fields
in the VS_FIXEDFILEINFO) and see that the changes had occurred.
Generalc++ Pin
Jeff Szielenski30-May-00 10:02
Jeff Szielenski30-May-00 10:02 
GeneralRe: c++ Pin
Brigg Thorp1-Jun-00 1:51
Brigg Thorp1-Jun-00 1:51 
GeneralRe: c++ Pin
Member 14741-Jun-00 9:31
Member 14741-Jun-00 9:31 
GeneralRe: c++ Pin
Brigg Thorp2-Jun-00 1:19
Brigg Thorp2-Jun-00 1:19 
GeneralRe: c++ Pin
Member 7505-Jun-00 18:12
Member 7505-Jun-00 18:12 
GeneralFirst-chance exception Pin
nickinchina30-May-00 9:56
nickinchina30-May-00 9:56 
GeneralRe: First-chance exception Pin
Tim Deveaux30-May-00 13:04
Tim Deveaux30-May-00 13:04 
GeneralRe: First-chance exception Pin
Arvind2330-May-00 13:53
Arvind2330-May-00 13:53 
GeneralAccess Violation Pin
Adam Clauss30-May-00 5:58
Adam Clauss30-May-00 5:58 
GeneralRe: Access Violation Pin
Paolo Messina30-May-00 7:54
professionalPaolo Messina30-May-00 7:54 
GeneralRe: Access Violation Pin
Adam Clauss30-May-00 9:11
Adam Clauss30-May-00 9:11 
GeneralRe: Access Violation Pin
Paolo Messina30-May-00 10:35
professionalPaolo Messina30-May-00 10:35 
GeneralRe: Access Violation Pin
Adam Clauss30-May-00 13:18
Adam Clauss30-May-00 13:18 
GeneralRe: Access Violation Pin
Paolo Messina31-May-00 5:09
professionalPaolo Messina31-May-00 5:09 
GeneralRe: Access Violation Pin
Peter Zajac31-May-00 4:38
Peter Zajac31-May-00 4:38 
GeneralRe: Access Violation Pin
Adam Clauss31-May-00 5:20
Adam Clauss31-May-00 5:20 
GeneralAccess Violation Pin
Adam Clauss30-May-00 5:56
Adam Clauss30-May-00 5:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.