> The shared library does sound cleaner. However, the details of function > dispatch arent hidden from the creator in this approach. The assembly in > the Palm sample apps looks a bit hairy, I'm more of an x86 guy myself. Is > that code doing basically the same thing as my structure of function > pointers? Further, I've heard the newest version of CW has a library > wizard. Does CW take care of the details? Also, what about efficiancy, is > there a noticable difference between the two methods?
The library wizard in CW Palm 8 gives you a dialog where you enter API names, then it generates your new project with the dispatch table and library skeleton all setup for it. The generated code also has some "non-global" permanent storage logic and support for uninstalling the library after the last client closes it. The generated code is similar to Palm's SampleLib project, but with a lot of cleanup and a header file with inline functions for opening and closing the library cleanly. As for efficiency, calling a shared library function involves: 1) system trap 2) table lookup 3) indirect jump It's not as quick as going through a function pointer, but it isn't terrible. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
