U
Uday Bidkar
I am trying to register my interface with IConnectionPoint of outlook
reminders to capture some Outlook Reminder events and having some
issues. Here goes the pseudo code
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
//Register class CMyEventHandler : public IDispatch with
IConnectionPoint of Outlook reminder
//Removed Wizard generated code for registering the widow class and
initializing the window
// And Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
If this is the code I do get control back in CMyEventHandler::Invoke()
when some Reminder event occurs as a notification from outlook.
But if I replace the message loop with while(1){} I dont get any such
notifications, instead outlook hangs.
Looking at the Main message loop, it seems that its also a infinite
loop unless GetMessge() returns Zero for WM_QUIT. What I want to know
is why i dont get notified by Outlook if there is actual infinite loop
instead of message loop? What make message loop different than
while(1){} ?
Thanks in advance
reminders to capture some Outlook Reminder events and having some
issues. Here goes the pseudo code
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
//Register class CMyEventHandler : public IDispatch with
IConnectionPoint of Outlook reminder
//Removed Wizard generated code for registering the widow class and
initializing the window
// And Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
If this is the code I do get control back in CMyEventHandler::Invoke()
when some Reminder event occurs as a notification from outlook.
But if I replace the message loop with while(1){} I dont get any such
notifications, instead outlook hangs.
Looking at the Main message loop, it seems that its also a infinite
loop unless GetMessge() returns Zero for WM_QUIT. What I want to know
is why i dont get notified by Outlook if there is actual infinite loop
instead of message loop? What make message loop different than
while(1){} ?
Thanks in advance