Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!att!cbnewsl!dog From: dog@cbnewsl.ATT.COM (edward.n.schiebel) Newsgroups: comp.lang.c++ Subject: Re: C++ and SunView Message-ID: <3811@cbnewsl.ATT.COM> Date: 24 Jan 90 17:28:15 GMT References: <1804@unccvax.UUCP> Distribution: usa Organization: AT&T Bell Laboratories Lines: 27 From article <1804@unccvax.UUCP>, by cs00wsc@unccvax.UUCP (Shiang Chin): > I have a problem when I create applications using > C++ and SunView. For example, If I define a class: > > [Class A with member function int a(); declared ] > > and create a window with some command buttons by using SunView > library. I assigned the method 'a()' to one of the command > button as a called back notify procedure. You cannot do this. When SunView calls (), it does not know what A to call it with. Remember, a() as a member function is called as anA.a(). SunView is passing its own parameters in (I think a notify procedure is called with a Panel_item and an Event*). > Assumming the value stored in the variable 'a' now > is 100, when I clicked the mouse on that command button the > value printed out should be '100', but the value I > got was not correct. It guess was just (a lack of) luck that the program didn't core dump. When SunView called a(), there is no 'this'. > Wen S. Chin at UNC Charlotte Ed Schiebel AT&T Bell Laboratories dog@vilya.att.com