I am trying to register my interface with IConnectionPoin t of outlook
reminders to capture some Outlook Reminder events and having some
issues. Here goes the pseudo code
int APIENTRY _tWinMain(HINST ANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
//Register class CMyEventHandler : public IDispatch with
IConnectionPoin t of Outlook reminder
//Removed Wizard generated code for registering the widow class and
initializing the window
// And Main message loop:
while (GetMessage(&ms g, NULL, 0, 0))
{
if (!TranslateAcce lerator(msg.hwn d, hAccelTable, &msg))
{
TranslateMessag e(&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 4 2858
Uday Bidkar wrote:
I am trying to register my interface with IConnectionPoin t of outlook
reminders to capture some Outlook Reminder events and having some
issues. Here goes the pseudo code
int APIENTRY _tWinMain(HINST ANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
//Register class CMyEventHandler : public IDispatch with
IConnectionPoin t of Outlook reminder
//Removed Wizard generated code for registering the widow class and
initializing the window
// And Main message loop:
while (GetMessage(&ms g, NULL, 0, 0))
{
if (!TranslateAcce lerator(msg.hwn d, hAccelTable, &msg))
{
TranslateMessag e(&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
None of the above is C++. Please post your question in a relevent
newsgroup that deals with that particular operating system.
[5.9] Which newsgroup should I post my questions? http://www.parashift.com/c++-faq-lite/how-to-post.html
Uday Bidkar wrote:
while (GetMessage(&ms g, NULL, 0, 0))
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){} ?
The main difference is that '1' is not the same as 'GetMessage (....)'.
Thinking a bit, the name 'GetMessage' suggests that it gets a message, so
the difference is that with 'while (1)' you never get a message. The next
logical step is to read something about Windows messages.
--
Salu2
Thanks Julián for responding.
The documentation for GetMessage say that if the function retrieves a
message other than WM_QUIT, the return value is nonzero and if the
function retrieves the WM_QUIT message, the return value is zero. This
means that while (GetMessage(&ms g, NULL, 0, 0)) is same as while(1)
unless WM_QUIT is the message retrieved from message queue so why the
difference in behavior?
I apologize for posting this in wrong newsgroup.
Uday Bidkar wrote:
The documentation for GetMessage say that if the function retrieves a
message other than WM_QUIT, the return value is nonzero and if the
function retrieves the WM_QUIT message, the return value is zero. This
means that while (GetMessage(&ms g, NULL, 0, 0)) is same as while(1)
unless WM_QUIT is the message retrieved from message queue so why the
difference in behavior?
The difference is that '1' does nothing with 'msg'
but 'GetMessage(&ms g, ...' does something with it. Read about Windows
messages in any article, book or help file about Windows programming.
If you come from some functional programming language, forget all about "no
secondary effects".
--
Salu2 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Jim |
last post by:
Im getting way too many rows retured..what its trying to do is insert
a 0 for revenue for months 7 - 12 (aka July through December) for each
of these cost centers for each payor type..Im getting a lot of repeats
and the concatenation field date always comes back as January 2003
instead of the month and date its supposed to
--Fiscal Year
|
by: RobG |
last post by:
A little while ago I opined that do/while loops are harder to
read than for loops, and therefore I preferred using for loops.
However, it was pointed out that do/while has significant
performance benefits as evidenced by:
<URL:http://www.websiteoptimization.com/speed/10/10-2.html>
(There's a bug in the page, testLoop is both a function name
and the name of the form but if you download the page & rename
|
by: Shamrokk |
last post by:
My application has a loop that needs to run every 2 seconds or so. To
acomplish this I used...
"Thread.Sleep(2000);"
When I run the program it runs fine. Once I press the button that starts the
looping function the window becomes unmovable and cannot close under its own
direction (the upper right "close 'X'")
My first attempt to solve the problem was to have the looping function
execute as its own thread, the idea being this would...
|
by: Rich |
last post by:
I was considering C# for developing a scientific application, but I have
noticed a ~30% difference between VC++ .NET and C# on the same machine,
under identical conditions:
double a = 0,b = 0, c = 0, d = 0, e = 0;
for(int n = 0; n != 6000000; n++)
{
a = n % 5 *2 / 3 - 4 + 6 / 3 - n + n * 2;
b = n * 2.3 - 1 *2 / 3 - 4 + 6 / 3 - n + n * 2;
c = n * 3 / 3.5 *2 / 3 - 4 + 6 / 3 - n + n * 2;
|
by: buc |
last post by:
I have a simple combox on the screen that is bound via a datareader to a
stored proc in sql that returns a simple string. The code is
'load stored proc then
dReader = tmpSQL.SQLcmd.ExecuteReader()
combobox1.DataSource = dReader
dReader.Read()
combobox1.DataTextField = dReader.GetName(0)
combobox1.DataBind()
| |
by: John Pass |
last post by:
What is the difference between a While and Do While/Loop repetition structure.
If they is no difference (as it seems) why do both exist?
|
by: mooreit |
last post by:
The purpose for my questions is accessing these technologies from
applications. I develop both applications and databases. Working with
Microsoft C#.NET and Microsoft SQL Server 2000 Production and 2005 Test
Environments.
What is the purpose of a view if I can just copy the vode from a view
and put it into a stored procedure?
Should I be accessing views from stored procedures?
|
by: rohitjogya |
last post by:
Can anyone tell me the difference bet for loop and while loop
execution?
____________________
for (i=0 ; i<10 ; i++)
; /* Do nothing*/
print i;
___________________
i=0;
|
by: Muzammil |
last post by:
whats the beauty of "malloc" over "new" why its helpful for
programmer.for its own memory area.??
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |