Article View: comp.windows.x
Article #38360Re: C++ and callbacks
From: Ronald.Geens
Date: Thu, 05 May 1994 07:52
Date: Thu, 05 May 1994 07:52
21 lines
2175 bytes
2175 bytes
In article <CpAn8x.5I1@news.cis.umn.edu>, ianhogg@milli.cs.umn.edu (Ian J Hogg) writes: |> >|> Motif is based on C, not C++. You have to use "extern C" linkage for any of |> >|> your callbacks. You can't register any C++ function directly. You have to |> >|> write a plain C front end for anything you want to have callbacked. |> > |> >Actually the function does not have to have "extern C" linkage. It just |> >can't be a non-static member function. |> > |> |> Actually, the callback function should have "C" linkage. I have used a |> compiler that passed arguments differently for C linkage and C++ linkage. |> So, if I had a free standing function with C++ linkage and used it as a |> callback function, the parameters would be messed up. This is not an issue |> with most compilers but be aware it could be. |> |> Can anyone guess the compiler in question? I really don't have a clue! I thought the discussoin was purely theoretical ! If you have worked with such a compiler, how did you use member functions as callbacks ? Or is it just not possible on such compilers ?
Technical Details
Message-ID:
<1994May5.075259.12146@reks.uia.ac.be>Path:
arc1-ca.pugleaf.net!gmd.de!nntp.gmd.de!urmel.informatik.rwth-aachen.de!newsserver.rrzn.uni-hannover.de!ina.zfn.uni-bremen.de!marvin.pc-labor.uni-bremen.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!xlink.net!howland.reston.ans.net!EU.net!ub4b!news.sri.ucl.ac.be!idefix.CS.kuleuven.ac.be!reks.uia.ac.be!newsReferences:
<pauld.767898877@sarge> <2q65gv$oln@bigblue.oit.unc.edu> <2q67fpINNgv5@eccdb1.pms.ford.com> <CpAn8x.5I1@news.cis.umn.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103734,ad5a39011a2d3d26 X-Google-Attributes: gid103734,public X-Google-Thread: 109fba,ad5a39011a2d3d26 X-Google-Attributes: gid109fba,public X-Google-Thread: 10ba33,ad5a39011a2d3d26 X-Google-Attributes: gid10ba33,public X-Google-ArrivalTime: 1994-05-05 02:31:53 PST Newsgroups: comp.windows.x,comp.lang.c++,gnu.g++.help Path: arc1-ca.pugleaf.net!gmd.de!nntp.gmd.de!urmel.informatik.rwth-aachen.de!newsserver.rrzn.uni-hannover.de!ina.zfn.uni-bremen.de!marvin.pc-labor.uni-bremen.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!xlink.net!howland.reston.ans.net!EU.net!ub4b!news.sri.ucl.ac.be!idefix.CS.kuleuven.ac.be!reks.uia.ac.be!news From: rgeens@wins.uia.ac.be (Ronald.Geens) Subject: Re: C++ and callbacks Message-ID: <1994May5.075259.12146@reks.uia.ac.be> Sender: news@reks.uia.ac.be (USENET News System) Organization: U.I.A. References: <pauld.767898877@sarge> <2q65gv$oln@bigblue.oit.unc.edu> <2q67fpINNgv5@eccdb1.pms.ford.com> <CpAn8x.5I1@news.cis.umn.edu> Date: Thu, 5 May 1994 07:52:59 GMT Lines: 21