We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

How to call a simple C/C++ function from a Basic macro [closed]

asked 2016-06-10 00:48:39 +0200

abcabcabc gravatar image

updated 2020-07-10 21:06:32 +0200

Alex Kemp gravatar image

I work as a software analyst/developer (PhD level) and after I looked at the SDK and I got the impression that it is boycotted by its own developers or directors. I suppose one of the priorities for "Calc" is to provide an interface to custom functions from external shared libraries (.so in Linux), in a simple way like Microsoft Excel with VBA and C/C++ DLL.

My question is very simple: How could call a simple C/C++ function from a shared library in Linux that adds 1 + 1 = 2. For instance: void add(long n1, long n2, long *n3); Is the "Declare" statement suppose to work in LibreOffice Basic? Or is replaced by something else? Please provide a simple example. I would deeply appreciate that and I would try to add the LibreOffice site into my donations. Thank you.

PS. I am not sure what is supposed to be achieved by the SDK; probably to manipulate elements of LibreOffice Documents externally. But don't you think that a significant priority is to have a decent interface between macros ("Basic") and C/C++ for simple calculations like 1 + 1 = 2?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2020-09-07 22:29:26.249208

2 Answers

Sort by » oldest newest most voted

answered 2016-06-11 17:10:42 +0200

Ajohn gravatar image

I've no answer to your question but feel I must point out that ooBasic doesn't actually use integer at all. It uses floating point and rounds which wasted several days of my time. Something I just didn't expect and a 1st for any compiler I have ever used.

Personally I found the lack of Basic like syntax function to manipulate spreadsheets really disappointing. The easiest solution seems to be to write more macro's to provide them with the UNO facilities.


edit flag offensive delete link more

answered 2016-06-10 13:33:53 +0200

peterwt gravatar image

There is an OpenOffice Forum dedicated to using external programs which might help you.
See - OO Forum .

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-06-10 00:48:39 +0200

Seen: 1,356 times

Last updated: Jun 11 '16