It looks like it is a problem in Constructor not saving the data (or I'm
misunderstanding something).
When I open my rsrc file, MyResourceString has ABCDEFG in it (something I
previously entered). I backspace over these letters, click the View as Hex
button, and enter 0102030405060708. I save, close, and reopen the file, and
MyResourceString is ABCDEFG! This is very recreatable.
So now I create a NEW string resource, immediately choose View as Hex, again
enter 01..08, save and exit. When I reopen it, this string resource is
empty! I'm using Constructor 1.5b7.
If I enter the "string" in hex, unclick View as Hex, re-click View as Hex,
and then save, close, and reopen, the string usually updated. There is
something very strange going on. In fact, the string that was ABCDEFG
remains that, even if I enter hex while in View in Hex, toggle back and
forth, save, exit, etc. It continues to be ABC... Anyway, I can get binary
data out of the array, if I can get the array stored correctly.
Steve
"Richard Burmeister" <[EMAIL PROTECTED]> wrote in message
news:37403@palm-dev-forum...
>
> > From: Steve Achelis
> >
> > Can I store binary data in a string resource? I know I can enter
> > the string
> > in hex in Constructor, but I'm having trouble extracting it. For
example,
> > if in hex-mode I enter 0102030405060708 for my string resource, and
then:
> >
> > CharPtr pData = MemHandleLock( DmGetResource(strRsc,
MyResourceString) );
> >
> > and look in pData[0], it isn't 1 (which is what I was expecting)
> >
>
> Strange... I can do it with no problem. E.g.,
>
> Char s[20];
> Char *pData;
> pData = MemHandleLock( DmGetResource(strRsc, MyResourceString) );
> WinDrawChars(pData, 8, 10, 20);
> StrPrintF(s, "0:%d, 1:%d, 2:%d", pData[0], pData[1], pData[2]);
> WinDrawChars(s, StrLen(s), 10, 30);
>
> draws eight unprintable chars [boxes] at (10,20) and draws "0:1, 1:2, 2:3"
> at (10,30).
> How are you "looking in pData[0]" and what do you see that isn't "1"?
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/