At 11:55 PM 7/21/2004, you wrote:
I have a handle to a resource which is just a blob of binary data. It was opened like this:
MemHandle hData = DmGetResource('data', id);
I want to increase its size by a few bytes.
If I try this:
DmResizeResource(hData, oldSize + 4);
it fails with error code 0x0206 dmErrReadOnly.
I already unlocked the handle so I assume this is because DmGetResource opened the database in read-only mode. Is that correct?
What is the easiest way to increase the size of this resource? If I need to open the resource as writable, how can I do that? A pointer to a tutorial would be appreciated, since the docs seem to consider this a bit off the beaten path.
You need to open the database that contains the resource in read/write mode. By default, your program database is only open in read-only mode, so use a DmOpenDatabase call to reopen it for writing.
Thanks Ben. I thought this might be the case but I'm unsure on the details of implementing it.
I open using my creator ID, and type 'Rsrc', is that right?
Must I somehow close the resource database first? (I don't think I did anything special to open it, it's just automatically opened.) Will that ruin any locked handles I have to other resources in that database?
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
