I worte an OCX with events. In order to allow the dialog box (or
whatever) to be updated by the event, I had to add a messagepump to the
event.
void MessagePump()
{
MSG msg;
while (PeekMessage(&m sg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT) {
PostQuitMessage ((int)msg.wPara m); // resubmit WM_QUIT
// Also need to abort your action here
break;
}
TranslateMessag e(&msg); // Only needed if you allow keyboard messages
DispatchMessage (&msg);
}
}
How can I create a MessagePump in managed code?
--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com