QOF iteration and callbacks
linux at codehelp.co.uk
Fri Jun 18 10:51:03 EDT 2004
On Friday 18 June 2004 3:08, Linas Vepstas wrote:
> On Thu, Jun 17, 2004 at 10:46:33AM -0400, Derek Atkins was heard to remark:
> > > void gnc_bm_foreach (QofEntity obj, gpointer ud1); doesn't work. Why?
> > You need (QofEntity* obj, gpointer ud1).
> I'm guessing that the * was dropped accidentally, and then Niel
> had a very hard seeing that it was missing.
Precisely. I missed it because of my lack of familiarity with callbacks -
normally you get a much clearer warning from the compiler when you make a
typo like that.
However, that wasn't all that was missing. I'm testing this in a 'limited'
environment where only certain parts of the engine are initialised,
specifically, I haven't loaded any modules or any external files. What I
didn't realise is that I could not hope to use GNCInvoice in that environment
- it was never going to be properly registered with QofObject and would
therefore always generate the critical error. I've switched to testing
Account and it's coming along OK. No more critical errors from
qof_object_foreach. The iteration is solved, now I'm working on building the
> Once you miss
> something like that, the brain can leap to various incorrect
> conclusions, and then ...
> > > my brain is getting addled, is that
> > > example a declaration or just another cast?
> which didn't have anythingto do with the actual problem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20040618/bf44038f/attachment.bin
More information about the gnucash-devel