Hello,
I am a TOTAL newbie (read: never done anything) when it comes to
developing for OpenOffice.org. But I have done some development of MS
Excel add-ins in C, which end up being registered as additional
functions directly callable from an Excel spreadsheet. So, to make my
question clearer, let's say I have a pure C (not C++) module with one
public function:
int get_easter(int year, int* month, int* day);
Given a year (i.e. 2007), it will put into month and day the date for
Easter that year (i.e. month == 4, day == 8), and return something
useful (say, the int value 20070408). The question is: how can I make
this function available in Spreadsheet, so that I can write in any given
cell:
=GetEaster(2007)
and the function will return an Spreadsheet date value indicating
"8/Apr/2007"? Notice this entails several things:
* Registering the GetEaster() function so that Spreadsheet knows
about it, and knows what glue code (my C function) to call.
* Converting parameters when appropriate (2007 in this case).
* Calling the implementation function get_easter() with
appropriate parameters.
* Build a Date value with the result.
* Tell Spreadsheet about that resulting date.
* Hopefully, this should work under both Linux and Win32.
I know this could be done inside Spreadsheet for the case of Easter, but
this is just an example; the functions I have implemented are much more
complex than that. If anybody can point me to a manual, sample, tutorial
or any other resource, showing how this is handled correctly in
Spreadsheet, that would be grand.
Thanks and best regards,
--
Gonzalo Diethelm
[EMAIL PROTECTED]