Ask Your Question
0

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

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

abcabcabc 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 close merge delete

2 Answers

Sort by » oldest newest most voted
0

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
0

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.

John

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 854 times

Last updated: Jun 11 '16