If the form uses things like bitmaps and help string resources which would be found in the original PRC, they wouldn't be available when you tried to use your copy of it. Just thought I'd point that out, as poking around for all the possible dependant resources to copy along with the form would be a real pain.
I'm looking at doing something rather similar, but with 'armc' resouces. :) Best of luck Charles, and thanks for the nifty example, Jonathan. Brandon On Thu, 10 Feb 2005 16:33:07 -0500, Hays, Jonathan (GE Infrastructure) <[EMAIL PROTECTED]> wrote: > Hi Charles, > I don't know if you've looked at the overlay support, but that might be a > better way to go than what you're thinking. However, if you have reasons > that I might not understand, you _can_ use the following code (I have no idea > if it works on Cobalt, however): > > //Code to utilize a form from another application or resource DB... > MemHandle handle = > DmGetResourceIndex(dbRefOfOtherApplication,recordId); > MemPtr ptr = MemHandleLock(handle); > UInt16 index = 0xFFFF; > > MemHandle formHandle = DmNewResource(dbRefOfCurrentApplication, > 'tFRM', index, MemPtrSize(ptr)); > MemPtr dest = MemHandleLock(formHandle); > DmWrite(dest, 0, ptr, MemPtrSize(ptr)); > MemHandleUnlock(formHandle); > MemHandleUnlock(handle); > DmReleaseResource(handle); > FormPtr form = FrmInitForm(index); > > //Use the form, blah, blah, blah... > > //Use this when you're done with it... > FrmDeleteForm(form); > DmRemoveResource(dbRefOfCurrentApplication, index); > > Hope that helps! > > -Jon > > ------------------------------------------- > Jonathan Hays > Palm OS Certified Developer > http://hazelware.luggle.com > ------------------------------------------- > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Charles > Sent: Thursday, February 10, 2005 7:16 AM > To: Palm Developer Forum > Subject: Use form stored in separate prc? > > I'm writing an application that needs to be branded for different customers, > and localized for other languages. Here's the general idea - I would have > two .prc's. The first (call it a StubLauncher) would be contain all of the > resources (icons, bitmaps, forms, strings, etc). It would take care of the > customer specific stuff. The only logic it would have would be to launch the > second prc, which would be totally generic, passing parameters to identify > the name of the database to access and the creator id of itself, etc. The > second prc would not contain any resources - it would need to access them all > from the StubLauncher. For the localization part, I would have overlays for > the StubLauncher. > > So, here's the basic question: > Is it possible to use forms that are stored in another .prc file? > > -- > For information on using the Palm Developer Forums, or to unsubscribe, please > see http://www.palmos.com/dev/support/forums/ > > -- > For information on using the Palm Developer Forums, or to unsubscribe, please > see http://www.palmos.com/dev/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
