paragui-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-users] re: posting message


From: Keith Swyer
Subject: [paragui-users] re: posting message
Date: Fri, 22 Nov 2002 12:53:26 -0400

well, i'll be a little more specific with the problem i am having.

i have 3 main classes that interact with messages. sprite, spritelist and
lesson. the lesson loads a spritelist, which is just a list of sprites. when
i call spritelist.play, the sprites are looped through and changed to the
next frame... anyway, when a sprite is done playing, it sends a mesage to
the spritelist saying 'i'm done'. when all sprites are finished playing, the
spritelist then sends a message to the lesson saying that the animation is
now finished. the lesson can then move on to doing the next part after the
animation. however, messages are often received by one class before the
class that sends the message returns from the function that sent the
message. my specific example is that when an animation is complete, then
eventStop method i have in the spritelist sends a message to the lesson, the
lesson receives this message BEFORE the spritelist exits from its' eventStop
function. the lesson then calls the destructor or another method from the
spritelist, which changes the memory space of the sprite list.... now,
however, when the program stack finally returns to the function in
spritelist that originally sent the message to lesson, the address space has
changed, so returning from the function causes access violations. this is
only one example, but a similar effect happens with a few other
message/class connections.

so you see, i need a way to delay the receiving of a message by one class
until the sending function of the other class returns. on a windows machine
this is accomplished by a function PostMessage instead of a SendMessage.

does this help in seeing what my problem is? or do you still think that it
should work?

thanks again.
--Keith






reply via email to

[Prev in Thread] Current Thread [Next in Thread]