|
From: Ioannis V. <no...@ho...> - 2002-07-30 21:55:52
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Daniel Glenfield
> Sent: Tuesday, July 30, 2002 4:29 PM
> To: dev...@li...
> 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)
That you wrote:
Obj.SetErrorLog( &Obj )
should work (you ommitted a ;).
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|