> 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/

Reply via email to