My program is compiled but when I run it, it blocks. When I close this, Windows gives me the typical error window (send error or not send). Debuging, vc++ says: "Infraction of access on having read the location 0xccccccd0."
That's not enough information to help. Maybe you set receiver within some sub-function, so it's out of scope and no longer valid memory? Or maybe you do something once tecla is true which causes the problem?
But could also be other reasons which we can't see with that code. The eventreceiver looks ok and as long as the scope of receiver is fine you also set it the right way. So your problem is in another place.
No, the two versions are exactly the same besides that one uses the default constructor while the other uses the copy constructor (IMHO). I suspect the same problem CuteAlien already mentioned.
hehehe i was about to delete that post, i gues im still sleepy =P.
could u post the rest of the code, and one more thing, debug your app a little, put breakpoints in the onevent method and see what happends, check where do u get the null pointer(that error is usually due to a null pointer somewhere, thats why i sugested the constructor thing, when u dont initialize a var u get that error).