>> I want to be able to change what these say if I need to at runtime.
>> Due to the way things work, I need this to happen at runtime. 
>
>Do you need to change the text to be something arbitrary, or do you just
>need to switch between a small set of alternates?  If the latter, then you
>could do it by changing the form's help ID number at runtime.
>

Unfortunately I need to be able to set the values to something arbitrary at
runtime.  I don't know at compile time what parts of the help need to be, so
I'm afraid I can't simple use a small set of predefined resource strings.

>> I've tried changing the resource using the data manager but 
>> this didn't work. It seemed to let me write the new string resource to 
>> the app, but when I tried to get it or just display the help,
>> it hadn't been updated. 
>
>That should have worked.  Maybe post your code here.
>

I wasn't sure that it would (self modifying code... eeuugghh... etc).

Anyway, having gone back to it and played with it a bit, I have managed to
get it to work.

So, for anyone interested in how to do this... here's some sample code:

{
        //declare and init vars
        Handle  resH = NULL;
        CharPtr strP = NULL;
        
        //get resource string and lock
        resH = DmGet1Resource ('tSTR', 1000);
        strP = MemHandleLock(resH);

        //!!!

        //change value
        DmStrCopy(strP, 0, "SNAFU");

        //unlock and free       
        MemHandleUnlock(resH);
        DmReleaseResource(resH);
}


Where the '//!!!' is, I obviously need to do some handle resizing...  But,
as long as your new string is smaller than the old one, you can use this
code to test the basic principle.

>-slj-
>

Thanks for your help.


Cheers
Russell

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to