i am sorry, this:
SecClass :: SecClass( MainClass nMainClass )
was meant to be this:
SecClass :: SecClass( MainClass *nMainClass )
i already have the assigment constructor, as for the copy constuctor, not(because i don't need it). in the SecClass constructor it was meant to pass the address of the MainClass, so the SecClass can access MainClass object and functions
and as for the crash, i am very sure that it crashes when the SecClass tryes to access on member of the MainClass after calling the MainClass destructor, i used breakpoints to test this...
Edit: the real code is a lot more complex, this was just an example witch i used to express my problem easy