04-10-2013, 12:15 AM
Hi Gintaras,
I try to replace mdb database with UpdateResource function. The function work fine and replace database in my exe but this code corrupts my DB.
What is wrong?
Thank's
Alessandro
I try to replace mdb database with UpdateResource function. The function work fine and replace database in my exe but this code corrupts my DB.
str tempexesave.from(_qmdir "temp.exe")
str mdbtosave.from(_qmdir "data.mdb")
;create a exe copy
cop ExeFullPath tempexesave
;replace old database
int r=BeginUpdateResource(tempexesave 0)
str filedainc.getfile(mdbtosave)
long lenfiledainc=filedainc.len
UpdateResource(r +10 +200 0 &filedainc lenfiledainc)
r=EndUpdateResource(r 0)
What is wrong?
Thank's
Alessandro