[Gambas-devel] Gambas-devel Digest, Vol 6, Issue 3

chintan rao chintanraoh at ...176...
Sun Nov 5 02:33:36 CET 2006


Hi

>
> ---------- Forwarded message ----------
> From: Benoit Minisini <gambas at ...1...>
> To: mailing list for gambas developers <gambas-devel at lists.sourceforge.net
> >
> Date: Sat, 4 Nov 2006 11:28:38 +0100
> Subject: Re: [Gambas-devel] Concerning Bug(?):signal 6 on adding the
> function GB.Hook
> On Saturday 04 November 2006 02:08, chintan rao wrote:
> > Hi guys,
> > I added GB.Hook function to gb.pcre and gb.imageon including the
> > component in the
> > gambas program it gave the same error as it gave for my component.
> > Thanking you,
> > Chintan Rao H
>
> Actually hooks are not automatically chained, so you must do it yourself
> in
> the hook_main1 function. Otherwise, only the last registered hook will be
> called, and gb.qt will abort if the code in its main hook function is not
> executed.
>
> This is mentioned in the interpreter API doc briefly at
> http://gambasdoc.org//help/api/name/gb.hook.
>
> So you must do:
>
> static void (*old_main_hook)();
>
> static void hook1_main ( int *argc, char **argv )
> {
>  // call it first, so that main hooks are called in the order
>  // of components.
>
>  (*old_main_hook)(argc, argv);
>
>  // ... my code
> }
>
> int EXPORT GB_INIT ( void )
> {
>  old_main_hook = GB.Hook(GB_HOOK_MAIN, (void *)hook1_main);
>  return 0;
> }
>
> Regards,
>
> --
> Benoit Minisini



Thanks for your reply . I had done what you said.
But the only problem i had added old_hook at the bottom of the code.
of the code. It gave me error "circular references detected".
I thought calling old_hook function is a mistake.
Now it works fine.
Sorry for giving you trouble.

Thanking you,
Chintan Rao H
OPEN @ NITK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20061105/740bfbf6/attachment.html>


More information about the Devel mailing list