Re: XForms: Segmentation Faults with C++

Stephen Huyssoon (huyssoons@advancia.com)
Thu, 25 Feb 1999 09:13:00 -0600

# To subscribers of the xforms list from Stephen Huyssoon <huyssoons@advancia.com> :

Thomas Thiel wrote:

> # To subscribers of the xforms list from Thomas Thiel <wolfchild@home.ivm.de> :
>
> Hi !
>
> At 11:00 25.02.1999 +0000, you wrote:
>
> >> // fl_set_object_callback(DoTurn,&DoTurnCallback,0);
>
> >Probably not your problem, but this will never work. You can't give for a
> >callback a member function, since in order to execute a member function
> >you need an object + a function, and C code (i.e. XForms) cannot provide
> >the object. There are a number of workarounds to this, but you should
> >first try to see where the code you sent us goes bang and solve this
> >later.
>
> Yeah, I know understand what you said. As i wrote this code I thought i
> could handle the function call from inside the class just like global
> function. I was corrected by gcc, who gave me enlightment in this
> question.... :)
> But I am interested in the workarounds you mentioned ! Would you please
> show me one or two of these ?

Just make any such class functions static. Then, call the functionas you would
any non class function but with the class scoping
operator:

classname::staticclassfunction( argument );

Good day.

--
  (Stephen Huyssoon)
>=========================================>
  (huyssoons@advancia.com)

To Infinity and Beyond! -- Me and Buzz Lightyear

Julia's Law of Software Development: Business is business and programming is not. -- Julia

Burt's Principle for Programming: Less is more, and cheese is a fundamental ingredient.

_________________________________________________ To unsubscribe, send the message "unsubscribe" to xforms-request@bob.usuhs.mil or see http://bob.usuhs.mil/mailserv/xforms.html XForms Home Page: http://bragg.phys.uwm.edu/xforms List Archive: http://bob.usuhs.mil/mailserv/list-archives/