Hello,

I'm having a mysterious event handling problem in a carbon shared
library. I am using ReceiveNextEvent to propagate events to a progress
window (that I create). But after the event loop is done, and the
progress window is disposed, the host application is still getting
blocked by something. If I comment out the ReceiveNextEvent call, then
the host app operates fine.

I feel like I must be missing some sort of clean-up operation, but I
am already removing the event handlers and disposing the window and
controls. Here is a code snippet that shows where I am calling
ReceiveNextEvent:

//=========================
bool wProgressWindow::Update(const long &current, const long
&completion) {
OSStatus err = noErr;
EventRef eventRef = 0;
float timeout = 0.001;//kEventDurationForever;

// Update the progress data
Current = current;
Completion = completion;

if(current == completion) _Done = true;

EventTypeSpec eventList[] = {
{kEventClassWindow, kEventWindowUpdate},
{kEventClassWindow, kEventWindowDrawContent},
{kEventClassControl, kEventControlHit },
{kEventClassMouse, kEventWindowActivated},
{kEventClassMouse, kEventWindowDeactivated},
{kEventClassMouse, kEventMouseDown},
{kEventClassMouse, kEventMouseUp},
{kEventClassKeyboard, kEventRawKeyDown},
};

if(_WindowRef) {
if(!_Done) {
err = ReceiveNextEvent(
GetEventTypeCount(eventList),
eventList,
timeout,
kEventRemoveFromQueue,
&eventRef);

if(err == noErr && eventRef) {
SendEventToEventTarget(eventRef,
GetWindowEventTarget(_WindowRef));
ReleaseEvent(eventRef);
}
}
}

return _Done;
}
//=========================

// Call from host app:
// create progress window
// do calcution loop {
// call progress update
// }
// destroy window
// return to host app

Thanks in advance for any suggestions!

Steven J. Walker
Walker Effects
[url]www.walkereffects.com[/url]
[email]stevewalkereffects.com[/email]