This.SetupEnvironment is called from the Init. I wouldn't expect you to get an object type from oApp when the Init (or whatever is called from the init) hasn't completed.
But aside from that, oApp needs to be essentially public. Your ON SHUTDOWN code is code that must be good from anywhere.
>First, thank you for your reply.
>When I stepped through the code, I realized that potential for mishap and in the 'init' I have now only one line 'this.setupenviorment' and this new method has all this code and the debugger clearly shows oApp as on object yet I still have the same error. I am really baffled here specially when this method is done away with and its code is a procedure in the main program, I still get this error.
Charlie