|
From: Abhijit S. <mu...@gm...> - 2002-07-30 16:48:10
|
It seems it should work (though I haven't tried it)... though it beats me why you should pass in an exception object to an exception method... it defeats the purpose of OOP, that of every object being self-contained. It should, I feel, be Exception::SetErrorLog(); -------------------------- "I'm not as thunk as you drink I am." -------------------------- Checked with NAV 2002 http://mudeth.tripod.com ----- Original Message ----- From: "Daniel Glenfield" <sp...@ho...> To: <dev...@li...> Sent: Tuesday, July 30, 2002 6:58 PM Subject: [Dev-C++] Object passing itself > Can an object pass itself into the function it is calling? > > void DevModeDlg::OnSysCommand( UINT ID, LPARAM LParameter ) > { > try > { > DoOnSysCommandWork(); > } > catch ( Exception &Obj ) > { > Obj.SetErrorLog( &Obj ) // <--- Here > } > > } > > > where SetErrorLog > > void Exception::SetErrorLog( Exception &Obj ) > { > //... create a text file and put in data contained in Obj. > } > > I tried 'this' but b/c I'm inside another class' function it tries to pass > that object (DevModeDlg) |