QOF iteration and callbacks
warlord at MIT.EDU
Fri Jun 18 11:51:01 EDT 2004
Neil Williams <linux at codehelp.co.uk> writes:
> 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.
Not when you cast it. The cast hides the compiler warnings.
> 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
> rule sets.
That would do it.
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the gnucash-devel