> The first way is to have a single entry
> point to your plugin. You define __startup__ to be your
> first function.  The prc that you end up with is a code
> resource, and to use it you open it up using the Dm
> manager, cast the pointer to the resource as a function,
> and then call it.  You pass the function a structure, the
> most important element being a 'mode' that says what to do.
> If mode is '1', you call 'version';  if mode is '2', you
> call open; '3' is close; etc.   The rest of the structure
> gets used in the lower functions.  The good thing about
> doing things this way is that the compiler handles the
> calling of the other function within your plugin and that
> you only have to worry about a single function in your
> application.
Why not give this entry function two params. The first the mode and second a
untyped pointer.
Depending on the mode this entry function casts the pointer to some struct
containing the needed vars and then calls the apropriate function with that
struct (or the values in the struct). This would give the flexibility you
want with the "simple" first solution.


Jens


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