To get the SetTimer identity #2

Hi,

I have a dialog on which the timer is displayed using SetTimer() which
is binded to the dialog.Is there any API  that identify this timer
which is got set .....

So that, with that id i can call some API which makes the timer to
start from that time it was already showing at.....

0
4/5/2007 1:04:28 PM
vc.mfc 33608 articles. 0 followers. Follow

17 Replies
911 Views

Similar Articles

[PageSpeed] 16

isnt it the same id u called SetTimer with .....
"lucky" <Laxmanmaruthy@gmail.com> wrote in message 
news:1175778268.053331.256800@o5g2000hsb.googlegroups.com...
> Hi,
>
> I have a dialog on which the timer is displayed using SetTimer() which
> is binded to the dialog.Is there any API  that identify this timer
> which is got set .....
>
> So that, with that id i can call some API which makes the timer to
> start from that time it was already showing at.....
> 


0
mubi (158)
4/5/2007 1:18:04 PM
On Apr 5, 6:18 pm, "Mubashir Khan" <m...@yahoo.com> wrote:
> isnt it the same id u called SetTimer with ....."lucky" <Laxmanmaru...@gmail.com> wrote in message
>
> news:1175778268.053331.256800@o5g2000hsb.googlegroups.com...
>
>
>
> > Hi,
>
> > I have a dialog on which the timer is displayed using SetTimer() which
> > is binded to the dialog.Is there any API  that identify this timer
> > which is got set .....
>
> > So that, with that id i can call some API which makes the timer to
> > start from that time it was already showing at.....- Hide quoted text -
>
> - Show quoted text -


Ya, i did it has

SetTimer((UINT)&callCounter,1000,
(TIMERPROC)CallCounterDisplayTimerProc);

the CallCounterDisplayTimerProc() used to increment the time.

But it is displaying from the beginning i.e. 00:00:00 but not starting
from where it was before for Ex: 00:01:30

May be i think the new timer is getting set.......



0
4/5/2007 2:00:25 PM
I think you misunderstood how to use SetTimer.  The first parameter is not a 
pointer to a UINT.  It's just a UINT. I don't really know why Microsoft came 
up with UINT_PTR.
#define UINT_PTR UINT

Any way the first parameter is the ID you want to give the timer 100, 101, 
1000, it really doesn't matter what the number is.  Now that is the number 
that will be use to stop the timer.

for Example
SetTimer(100,1000,NULL);  //this will set a timer which will send a WM_TIMER 
message every 1 second.

If you want to kill this timer
KillTimer(100);

Now if you want to use SetTimer's callback functionality then you ignore the 
first parameter all together. SetTimer will return an ID for the timer you 
just created.

m_TimerID = SetTimer(0,1000, CallCounterDisplayTimerProc);

and when you want to kill this timer you have to call
KillTimer(m_TimerID);

Now if you want to reset what you display to zero, then simply set the value 
that you increment every time the timer hits to zero.

AliR.








"lucky" <Laxmanmaruthy@gmail.com> wrote in message 
news:1175781625.627437.48340@n76g2000hsh.googlegroups.com...
> On Apr 5, 6:18 pm, "Mubashir Khan" <m...@yahoo.com> wrote:
>> isnt it the same id u called SetTimer with ....."lucky" 
>> <Laxmanmaru...@gmail.com> wrote in message
>>
>> news:1175778268.053331.256800@o5g2000hsb.googlegroups.com...
>>
>>
>>
>> > Hi,
>>
>> > I have a dialog on which the timer is displayed using SetTimer() which
>> > is binded to the dialog.Is there any API  that identify this timer
>> > which is got set .....
>>
>> > So that, with that id i can call some API which makes the timer to
>> > start from that time it was already showing at.....- Hide quoted text -
>>
>> - Show quoted text -
>
>
> Ya, i did it has
>
> SetTimer((UINT)&callCounter,1000,
> (TIMERPROC)CallCounterDisplayTimerProc);
>
> the CallCounterDisplayTimerProc() used to increment the time.
>
> But it is displaying from the beginning i.e. 00:00:00 but not starting
> from where it was before for Ex: 00:01:30
>
> May be i think the new timer is getting set.......
>
>
> 


0
AliR3470 (3236)
4/5/2007 3:25:36 PM
Well said AliR, about all the
details..

UINT_PTR is the type of an
object reference.  So, for an object
instance, the programmer can simply
use the object reference ' this ' to
give to the function.  This will correctly
identify the timer instance without
having to memorize the ID somewhere..

jmarc..


"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
news:MA8Rh.1522$w41.820@newssvr19.news.prodigy.net...
>I think you misunderstood how to use SetTimer.  The first parameter is not 
>a pointer to a UINT.  It's just a UINT. I don't really know why Microsoft 
>came up with UINT_PTR.
> #define UINT_PTR UINT
>
> Any way the first parameter is the ID you want to give the timer 100, 101, 
> 1000, it really doesn't matter what the number is.  Now that is the number 
> that will be use to stop the timer.
>
> for Example
> SetTimer(100,1000,NULL);  //this will set a timer which will send a 
> WM_TIMER message every 1 second.
>
> If you want to kill this timer
> KillTimer(100);
>
> Now if you want to use SetTimer's callback functionality then you ignore 
> the first parameter all together. SetTimer will return an ID for the timer 
> you just created.
>
> m_TimerID = SetTimer(0,1000, CallCounterDisplayTimerProc);
>
> and when you want to kill this timer you have to call
> KillTimer(m_TimerID);
>
> Now if you want to reset what you display to zero, then simply set the 
> value that you increment every time the timer hits to zero.
>
> AliR.
>
>
>
>
>
>
>
>
> "lucky" <Laxmanmaruthy@gmail.com> wrote in message 
> news:1175781625.627437.48340@n76g2000hsh.googlegroups.com...
>> On Apr 5, 6:18 pm, "Mubashir Khan" <m...@yahoo.com> wrote:
>>> isnt it the same id u called SetTimer with ....."lucky" 
>>> <Laxmanmaru...@gmail.com> wrote in message
>>>
>>> news:1175778268.053331.256800@o5g2000hsb.googlegroups.com...
>>>
>>>
>>>
>>> > Hi,
>>>
>>> > I have a dialog on which the timer is displayed using SetTimer() which
>>> > is binded to the dialog.Is there any API  that identify this timer
>>> > which is got set .....
>>>
>>> > So that, with that id i can call some API which makes the timer to
>>> > start from that time it was already showing at.....- Hide quoted 
>>> > text -
>>>
>>> - Show quoted text -
>>
>>
>> Ya, i did it has
>>
>> SetTimer((UINT)&callCounter,1000,
>> (TIMERPROC)CallCounterDisplayTimerProc);
>>
>> the CallCounterDisplayTimerProc() used to increment the time.
>>
>> But it is displaying from the beginning i.e. 00:00:00 but not starting
>> from where it was before for Ex: 00:01:30
>>
>> May be i think the new timer is getting set.......
>>
>>
>>
>
> 


0
jmarc (108)
4/5/2007 6:39:32 PM
Thanks jmarc.  But I don't follow what you are saying.  UINT_PTR is a UINT. 
I don't know what you mean by "UINT_PTR is the type of an object reference."
I don't get passing the this pointer as the timer id either.  You can do 
that if all you have is one timer per window.  but if you want to have 
multiple timers for a window you can't simply use this as your value for 
nIDEvent.

It would be a good practice to use defines for your Timer event id's (Unless 
you are calling the callback function way of using timers)

#define IDT_COUNTER                    100
#define IDT_SOMETHING                101
#define IDT_STOPEVERYTHING    102

//update the counter every 100 milliseconds
SetTimer(IDT_COUNTER,100,NULL);
//do something else every 1 second
SetTimer(IDT_SOMETHING,1000,NULL);
//and stop everything in 10 seconds
SetTimer(IDT_STOPEVERYTHING,10000,NULL);

void CMyWnd::OnTimer(UINT_PTR IDEvent)
{
    if (IDEvent == IDT_COUNTER)
    {
        Count();
    }
    else if (IDEvent == IDT_SOMETHING)
    {
        DoSomethingElse();
    }
    else if (IDEvent == IDT_STOPEVERYTHING)
    {
         KillTimer(IDT_STOPEVERYTHING);
         KillTimer(IDT_COUNTER);
         KillTimer(IDT_SOMETHING);
    }
    CWnd::OnTimer(nIDEvent);
}

AliR.

"jmarc" <jmarc@incursion-voyages.com> wrote in message 
news:EnbRh.43373$__3.21088@edtnps90...
> Well said AliR, about all the
> details..
>
> UINT_PTR is the type of an
> object reference.  So, for an object
> instance, the programmer can simply
> use the object reference ' this ' to
> give to the function.  This will correctly
> identify the timer instance without
> having to memorize the ID somewhere..
>
> jmarc..
>
>
> "AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
> news:MA8Rh.1522$w41.820@newssvr19.news.prodigy.net...
>>I think you misunderstood how to use SetTimer.  The first parameter is not 
>>a pointer to a UINT.  It's just a UINT. I don't really know why Microsoft 
>>came up with UINT_PTR.
>> #define UINT_PTR UINT
>>
>> Any way the first parameter is the ID you want to give the timer 100, 
>> 101, 1000, it really doesn't matter what the number is.  Now that is the 
>> number that will be use to stop the timer.
>>
>> for Example
>> SetTimer(100,1000,NULL);  //this will set a timer which will send a 
>> WM_TIMER message every 1 second.
>>
>> If you want to kill this timer
>> KillTimer(100);
>>
>> Now if you want to use SetTimer's callback functionality then you ignore 
>> the first parameter all together. SetTimer will return an ID for the 
>> timer you just created.
>>
>> m_TimerID = SetTimer(0,1000, CallCounterDisplayTimerProc);
>>
>> and when you want to kill this timer you have to call
>> KillTimer(m_TimerID);
>>
>> Now if you want to reset what you display to zero, then simply set the 
>> value that you increment every time the timer hits to zero.
>>
>> AliR.
>>
>>
>>
>>
>>
>>
>>
>>
>> "lucky" <Laxmanmaruthy@gmail.com> wrote in message 
>> news:1175781625.627437.48340@n76g2000hsh.googlegroups.com...
>>> On Apr 5, 6:18 pm, "Mubashir Khan" <m...@yahoo.com> wrote:
>>>> isnt it the same id u called SetTimer with ....."lucky" 
>>>> <Laxmanmaru...@gmail.com> wrote in message
>>>>
>>>> news:1175778268.053331.256800@o5g2000hsb.googlegroups.com...
>>>>
>>>>
>>>>
>>>> > Hi,
>>>>
>>>> > I have a dialog on which the timer is displayed using SetTimer() 
>>>> > which
>>>> > is binded to the dialog.Is there any API  that identify this timer
>>>> > which is got set .....
>>>>
>>>> > So that, with that id i can call some API which makes the timer to
>>>> > start from that time it was already showing at.....- Hide quoted 
>>>> > text -
>>>>
>>>> - Show quoted text -
>>>
>>>
>>> Ya, i did it has
>>>
>>> SetTimer((UINT)&callCounter,1000,
>>> (TIMERPROC)CallCounterDisplayTimerProc);
>>>
>>> the CallCounterDisplayTimerProc() used to increment the time.
>>>
>>> But it is displaying from the beginning i.e. 00:00:00 but not starting
>>> from where it was before for Ex: 00:01:30
>>>
>>> May be i think the new timer is getting set.......
>>>
>>>
>>>
>>
>>
>
> 


0
AliR3470 (3236)
4/5/2007 7:16:38 PM
Hi AliR, I fully agree with you about
a UINT_PTR is a UINT...  I'm just
trying to explain why UINT_PTR is
declared by microsoft.

I already used timer exactly the way
you shown.  For every id, a KillTimer
will have to be called.  There are a
timer for each id...

But, one day I had to face with a design
where pretty much timers was required.
For a collection of objects that behave the
same when the timer elapse, but with a
variable time, each time.  Also, an other
object's collection with other behavior
(in the same win application)..

So, the Cwnd provide the OnTimer
function to be called.  Then, I didn't
process anymore right away according
to IDs, but call a bussiness object method
just like ATimerHasElapse().  This bussiness
object, in turn, call another sub bussiness
object method, and so on.

void CMyWnd::OnTimer(UINT_PTR IDEvent)
{
    if(m_MyBussinessObject::ATimerHasElapse(IDEvent))
        return;
    else
        CWnd::OnTimer(nIDEvent);
}

Then, every object (instance) will be
call to process something.  Those objects
will just have to verify if the id received
fit to their 'this' before processing, and
maybe calling again SetTimer with another
value of time...

Just another way of using SetTimer...

jmarc...


"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
news:EZbRh.2908$H_5.1163@newssvr23.news.prodigy.net...
> Thanks jmarc.  But I don't follow what you are saying.  UINT_PTR is a 
> UINT. I don't know what you mean by "UINT_PTR is the type of an object 
> reference."
> I don't get passing the this pointer as the timer id either.  You can do 
> that if all you have is one timer per window.  but if you want to have 
> multiple timers for a window you can't simply use this as your value for 
> nIDEvent.
>
> It would be a good practice to use defines for your Timer event id's 
> (Unless you are calling the callback function way of using timers)
>
> #define IDT_COUNTER                    100
> #define IDT_SOMETHING                101
> #define IDT_STOPEVERYTHING    102
>
> //update the counter every 100 milliseconds
> SetTimer(IDT_COUNTER,100,NULL);
> //do something else every 1 second
> SetTimer(IDT_SOMETHING,1000,NULL);
> //and stop everything in 10 seconds
> SetTimer(IDT_STOPEVERYTHING,10000,NULL);
>
> void CMyWnd::OnTimer(UINT_PTR IDEvent)
> {
>    if (IDEvent == IDT_COUNTER)
>    {
>        Count();
>    }
>    else if (IDEvent == IDT_SOMETHING)
>    {
>        DoSomethingElse();
>    }
>    else if (IDEvent == IDT_STOPEVERYTHING)
>    {
>         KillTimer(IDT_STOPEVERYTHING);
>         KillTimer(IDT_COUNTER);
>         KillTimer(IDT_SOMETHING);
>    }
>    CWnd::OnTimer(nIDEvent);
> }
>
> AliR.
>
> "jmarc" <jmarc@incursion-voyages.com> wrote in message 
> news:EnbRh.43373$__3.21088@edtnps90...
>> Well said AliR, about all the
>> details..
>>
>> UINT_PTR is the type of an
>> object reference.  So, for an object
>> instance, the programmer can simply
>> use the object reference ' this ' to
>> give to the function.  This will correctly
>> identify the timer instance without
>> having to memorize the ID somewhere..
>>
>> jmarc..
>>
>>
>> "AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
>> news:MA8Rh.1522$w41.820@newssvr19.news.prodigy.net...
>>>I think you misunderstood how to use SetTimer.  The first parameter is 
>>>not a pointer to a UINT.  It's just a UINT. I don't really know why 
>>>Microsoft came up with UINT_PTR.
>>> #define UINT_PTR UINT
>>>
>>> Any way the first parameter is the ID you want to give the timer 100, 
>>> 101, 1000, it really doesn't matter what the number is.  Now that is the 
>>> number that will be use to stop the timer.
>>>
>>> for Example
>>> SetTimer(100,1000,NULL);  //this will set a timer which will send a 
>>> WM_TIMER message every 1 second.
>>>
>>> If you want to kill this timer
>>> KillTimer(100);
>>>
>>> Now if you want to use SetTimer's callback functionality then you ignore 
>>> the first parameter all together. SetTimer will return an ID for the 
>>> timer you just created.
>>>
>>> m_TimerID = SetTimer(0,1000, CallCounterDisplayTimerProc);
>>>
>>> and when you want to kill this timer you have to call
>>> KillTimer(m_TimerID);
>>>
>>> Now if you want to reset what you display to zero, then simply set the 
>>> value that you increment every time the timer hits to zero.
>>>
>>> AliR.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> "lucky" <Laxmanmaruthy@gmail.com> wrote in message 
>>> news:1175781625.627437.48340@n76g2000hsh.googlegroups.com...
>>>> On Apr 5, 6:18 pm, "Mubashir Khan" <m...@yahoo.com> wrote:
>>>>> isnt it the same id u called SetTimer with ....."lucky" 
>>>>> <Laxmanmaru...@gmail.com> wrote in message
>>>>>
>>>>> news:1175778268.053331.256800@o5g2000hsb.googlegroups.com...
>>>>>
>>>>>
>>>>>
>>>>> > Hi,
>>>>>
>>>>> > I have a dialog on which the timer is displayed using SetTimer() 
>>>>> > which
>>>>> > is binded to the dialog.Is there any API  that identify this timer
>>>>> > which is got set .....
>>>>>
>>>>> > So that, with that id i can call some API which makes the timer to
>>>>> > start from that time it was already showing at.....- Hide quoted 
>>>>> > text -
>>>>>
>>>>> - Show quoted text -
>>>>
>>>>
>>>> Ya, i did it has
>>>>
>>>> SetTimer((UINT)&callCounter,1000,
>>>> (TIMERPROC)CallCounterDisplayTimerProc);
>>>>
>>>> the CallCounterDisplayTimerProc() used to increment the time.
>>>>
>>>> But it is displaying from the beginning i.e. 00:00:00 but not starting
>>>> from where it was before for Ex: 00:01:30
>>>>
>>>> May be i think the new timer is getting set.......
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


0
jmarc (108)
4/5/2007 8:51:30 PM
Now I see what you mean.  That make more sense than using this pointer as 
the id.

AliR.

"jmarc" <jmarc@incursion-voyages.com> wrote in message 
news:mjdRh.54$Uf7.48@edtnps89...
> Hi AliR, I fully agree with you about
> a UINT_PTR is a UINT...  I'm just
> trying to explain why UINT_PTR is
> declared by microsoft.
>
> I already used timer exactly the way
> you shown.  For every id, a KillTimer
> will have to be called.  There are a
> timer for each id...
>
> But, one day I had to face with a design
> where pretty much timers was required.
> For a collection of objects that behave the
> same when the timer elapse, but with a
> variable time, each time.  Also, an other
> object's collection with other behavior
> (in the same win application)..
>
> So, the Cwnd provide the OnTimer
> function to be called.  Then, I didn't
> process anymore right away according
> to IDs, but call a bussiness object method
> just like ATimerHasElapse().  This bussiness
> object, in turn, call another sub bussiness
> object method, and so on.
>
> void CMyWnd::OnTimer(UINT_PTR IDEvent)
> {
>    if(m_MyBussinessObject::ATimerHasElapse(IDEvent))
>        return;
>    else
>        CWnd::OnTimer(nIDEvent);
> }
>
> Then, every object (instance) will be
> call to process something.  Those objects
> will just have to verify if the id received
> fit to their 'this' before processing, and
> maybe calling again SetTimer with another
> value of time...
>
> Just another way of using SetTimer...
>
> jmarc...
>
>
> "AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
> news:EZbRh.2908$H_5.1163@newssvr23.news.prodigy.net...
>> Thanks jmarc.  But I don't follow what you are saying.  UINT_PTR is a 
>> UINT. I don't know what you mean by "UINT_PTR is the type of an object 
>> reference."
>> I don't get passing the this pointer as the timer id either.  You can do 
>> that if all you have is one timer per window.  but if you want to have 
>> multiple timers for a window you can't simply use this as your value for 
>> nIDEvent.
>>
>> It would be a good practice to use defines for your Timer event id's 
>> (Unless you are calling the callback function way of using timers)
>>
>> #define IDT_COUNTER                    100
>> #define IDT_SOMETHING                101
>> #define IDT_STOPEVERYTHING    102
>>
>> //update the counter every 100 milliseconds
>> SetTimer(IDT_COUNTER,100,NULL);
>> //do something else every 1 second
>> SetTimer(IDT_SOMETHING,1000,NULL);
>> //and stop everything in 10 seconds
>> SetTimer(IDT_STOPEVERYTHING,10000,NULL);
>>
>> void CMyWnd::OnTimer(UINT_PTR IDEvent)
>> {
>>    if (IDEvent == IDT_COUNTER)
>>    {
>>        Count();
>>    }
>>    else if (IDEvent == IDT_SOMETHING)
>>    {
>>        DoSomethingElse();
>>    }
>>    else if (IDEvent == IDT_STOPEVERYTHING)
>>    {
>>         KillTimer(IDT_STOPEVERYTHING);
>>         KillTimer(IDT_COUNTER);
>>         KillTimer(IDT_SOMETHING);
>>    }
>>    CWnd::OnTimer(nIDEvent);
>> }
>>
>> AliR.
>>
>> "jmarc" <jmarc@incursion-voyages.com> wrote in message 
>> news:EnbRh.43373$__3.21088@edtnps90...
>>> Well said AliR, about all the
>>> details..
>>>
>>> UINT_PTR is the type of an
>>> object reference.  So, for an object
>>> instance, the programmer can simply
>>> use the object reference ' this ' to
>>> give to the function.  This will correctly
>>> identify the timer instance without
>>> having to memorize the ID somewhere..
>>>
>>> jmarc..
>>>
>>>
>>> "AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
>>> news:MA8Rh.1522$w41.820@newssvr19.news.prodigy.net...
>>>>I think you misunderstood how to use SetTimer.  The first parameter is 
>>>>not a pointer to a UINT.  It's just a UINT. I don't really know why 
>>>>Microsoft came up with UINT_PTR.
>>>> #define UINT_PTR UINT
>>>>
>>>> Any way the first parameter is the ID you want to give the timer 100, 
>>>> 101, 1000, it really doesn't matter what the number is.  Now that is 
>>>> the number that will be use to stop the timer.
>>>>
>>>> for Example
>>>> SetTimer(100,1000,NULL);  //this will set a timer which will send a 
>>>> WM_TIMER message every 1 second.
>>>>
>>>> If you want to kill this timer
>>>> KillTimer(100);
>>>>
>>>> Now if you want to use SetTimer's callback functionality then you 
>>>> ignore the first parameter all together. SetTimer will return an ID for 
>>>> the timer you just created.
>>>>
>>>> m_TimerID = SetTimer(0,1000, CallCounterDisplayTimerProc);
>>>>
>>>> and when you want to kill this timer you have to call
>>>> KillTimer(m_TimerID);
>>>>
>>>> Now if you want to reset what you display to zero, then simply set the 
>>>> value that you increment every time the timer hits to zero.
>>>>
>>>> AliR.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> "lucky" <Laxmanmaruthy@gmail.com> wrote in message 
>>>> news:1175781625.627437.48340@n76g2000hsh.googlegroups.com...
>>>>> On Apr 5, 6:18 pm, "Mubashir Khan" <m...@yahoo.com> wrote:
>>>>>> isnt it the same id u called SetTimer with ....."lucky" 
>>>>>> <Laxmanmaru...@gmail.com> wrote in message
>>>>>>
>>>>>> news:1175778268.053331.256800@o5g2000hsb.googlegroups.com...
>>>>>>
>>>>>>
>>>>>>
>>>>>> > Hi,
>>>>>>
>>>>>> > I have a dialog on which the timer is displayed using SetTimer() 
>>>>>> > which
>>>>>> > is binded to the dialog.Is there any API  that identify this timer
>>>>>> > which is got set .....
>>>>>>
>>>>>> > So that, with that id i can call some API which makes the timer to
>>>>>> > start from that time it was already showing at.....- Hide quoted 
>>>>>> > text -
>>>>>>
>>>>>> - Show quoted text -
>>>>>
>>>>>
>>>>> Ya, i did it has
>>>>>
>>>>> SetTimer((UINT)&callCounter,1000,
>>>>> (TIMERPROC)CallCounterDisplayTimerProc);
>>>>>
>>>>> the CallCounterDisplayTimerProc() used to increment the time.
>>>>>
>>>>> But it is displaying from the beginning i.e. 00:00:00 but not starting
>>>>> from where it was before for Ex: 00:01:30
>>>>>
>>>>> May be i think the new timer is getting set.......
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


0
AliR3470 (3236)
4/5/2007 8:56:59 PM
Sorry...  Now, the whole exemple...
Look at "OneOfManyObject::ProcessOnTimer"
method below..

void CMyWnd::OnTimer(UINT_PTR IDEvent)
{
    if( MyBussinessObject::ATimerHasElapse(IDEvent) )
        return;
    else
        CWnd::OnTimer(nIDEvent);
}


bool MyBussinessObject::ATimerHasElapse(UINT_PTR IDEvent)
{
    for(i=0; i< many; i++)
    {
        bool m_fDone = OneOfManyObject::ProcessOnTimer(IDEvent);
        if(m_fDone)
            return true;
    }

    for(j=0; j< manymore; j++)
    {
        bool m_fDone = OtherObject::ProcessOnTimer(IDEvent);
        if(m_fDone)
            return true;
    }

    return false;
}

............................  this method is the one to look at !!
bool OneOfManyObject::ProcessOnTimer(UINT_PTR IDEvent)
{
    if( IDEvent == this )      // Check if OnTimer() has been called for 
this object
    {                                  // Windows OnTimer() returns the id 
to do this kind of match
        ... do some process
        ... calculate another time value, or having to stop it...

        if(m_fAgain)
            StartTimer(this, m_NewTimeValue);   // To throw the timer 
again...
        else
            KillTimer(this);       // This object doesn't need a timer 
anymore, stop
        return true;                 // Indicating the owner of the timer 
has been found
    }
    else
        return false;                // Indicating this object is not the 
owner the elapsed time.
}
...............................

jmarc...


"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
news:RrdRh.2916$H_5.1824@newssvr23.news.prodigy.net...
> Now I see what you mean.  That make more sense than using this pointer as 
> the id.
>
> AliR.
>
> "jmarc" <jmarc@incursion-voyages.com> wrote in message 
> news:mjdRh.54$Uf7.48@edtnps89...
>> Hi AliR, I fully agree with you about
>> a UINT_PTR is a UINT...  I'm just
>> trying to explain why UINT_PTR is
>> declared by microsoft.
>>
>> I already used timer exactly the way
>> you shown.  For every id, a KillTimer
>> will have to be called.  There are a
>> timer for each id...
>>
>> But, one day I had to face with a design
>> where pretty much timers was required.
>> For a collection of objects that behave the
>> same when the timer elapse, but with a
>> variable time, each time.  Also, an other
>> object's collection with other behavior
>> (in the same win application)..
>>
>> So, the Cwnd provide the OnTimer
>> function to be called.  Then, I didn't
>> process anymore right away according
>> to IDs, but call a bussiness object method
>> just like ATimerHasElapse().  This bussiness
>> object, in turn, call another sub bussiness
>> object method, and so on.
>>
>> void CMyWnd::OnTimer(UINT_PTR IDEvent)
>> {
>>    if(m_MyBussinessObject::ATimerHasElapse(IDEvent))
>>        return;
>>    else
>>        CWnd::OnTimer(nIDEvent);
>> }
>>
>> Then, every object (instance) will be
>> call to process something.  Those objects
>> will just have to verify if the id received
>> fit to their 'this' before processing, and
>> maybe calling again SetTimer with another
>> value of time...
>>
>> Just another way of using SetTimer...
>>
>> jmarc...
>>
>>
>> "AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
>> news:EZbRh.2908$H_5.1163@newssvr23.news.prodigy.net...
>>> Thanks jmarc.  But I don't follow what you are saying.  UINT_PTR is a 
>>> UINT. I don't know what you mean by "UINT_PTR is the type of an object 
>>> reference."
>>> I don't get passing the this pointer as the timer id either.  You can do 
>>> that if all you have is one timer per window.  but if you want to have 
>>> multiple timers for a window you can't simply use this as your value for 
>>> nIDEvent.
>>>
>>> It would be a good practice to use defines for your Timer event id's 
>>> (Unless you are calling the callback function way of using timers)
>>>
>>> #define IDT_COUNTER                    100
>>> #define IDT_SOMETHING                101
>>> #define IDT_STOPEVERYTHING    102
>>>
>>> //update the counter every 100 milliseconds
>>> SetTimer(IDT_COUNTER,100,NULL);
>>> //do something else every 1 second
>>> SetTimer(IDT_SOMETHING,1000,NULL);
>>> //and stop everything in 10 seconds
>>> SetTimer(IDT_STOPEVERYTHING,10000,NULL);
>>>
>>> void CMyWnd::OnTimer(UINT_PTR IDEvent)
>>> {
>>>    if (IDEvent == IDT_COUNTER)
>>>    {
>>>        Count();
>>>    }
>>>    else if (IDEvent == IDT_SOMETHING)
>>>    {
>>>        DoSomethingElse();
>>>    }
>>>    else if (IDEvent == IDT_STOPEVERYTHING)
>>>    {
>>>         KillTimer(IDT_STOPEVERYTHING);
>>>         KillTimer(IDT_COUNTER);
>>>         KillTimer(IDT_SOMETHING);
>>>    }
>>>    CWnd::OnTimer(nIDEvent);
>>> }
>>>
>>> AliR.
>>>
>>> "jmarc" <jmarc@incursion-voyages.com> wrote in message 
>>> news:EnbRh.43373$__3.21088@edtnps90...
>>>> Well said AliR, about all the
>>>> details..
>>>>
>>>> UINT_PTR is the type of an
>>>> object reference.  So, for an object
>>>> instance, the programmer can simply
>>>> use the object reference ' this ' to
>>>> give to the function.  This will correctly
>>>> identify the timer instance without
>>>> having to memorize the ID somewhere..
>>>>
>>>> jmarc..
>>>>
>>>>
>>>> "AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
>>>> news:MA8Rh.1522$w41.820@newssvr19.news.prodigy.net...
>>>>>I think you misunderstood how to use SetTimer.  The first parameter is 
>>>>>not a pointer to a UINT.  It's just a UINT. I don't really know why 
>>>>>Microsoft came up with UINT_PTR.
>>>>> #define UINT_PTR UINT
>>>>>
>>>>> Any way the first parameter is the ID you want to give the timer 100, 
>>>>> 101, 1000, it really doesn't matter what the number is.  Now that is 
>>>>> the number that will be use to stop the timer.
>>>>>
>>>>> for Example
>>>>> SetTimer(100,1000,NULL);  //this will set a timer which will send a 
>>>>> WM_TIMER message every 1 second.
>>>>>
>>>>> If you want to kill this timer
>>>>> KillTimer(100);
>>>>>
>>>>> Now if you want to use SetTimer's callback functionality then you 
>>>>> ignore the first parameter all together. SetTimer will return an ID 
>>>>> for the timer you just created.
>>>>>
>>>>> m_TimerID = SetTimer(0,1000, CallCounterDisplayTimerProc);
>>>>>
>>>>> and when you want to kill this timer you have to call
>>>>> KillTimer(m_TimerID);
>>>>>
>>>>> Now if you want to reset what you display to zero, then simply set the 
>>>>> value that you increment every time the timer hits to zero.
>>>>>
>>>>> AliR.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> "lucky" <Laxmanmaruthy@gmail.com> wrote in message 
>>>>> news:1175781625.627437.48340@n76g2000hsh.googlegroups.com...
>>>>>> On Apr 5, 6:18 pm, "Mubashir Khan" <m...@yahoo.com> wrote:
>>>>>>> isnt it the same id u called SetTimer with ....."lucky" 
>>>>>>> <Laxmanmaru...@gmail.com> wrote in message
>>>>>>>
>>>>>>> news:1175778268.053331.256800@o5g2000hsb.googlegroups.com...
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> > Hi,
>>>>>>>
>>>>>>> > I have a dialog on which the timer is displayed using SetTimer() 
>>>>>>> > which
>>>>>>> > is binded to the dialog.Is there any API  that identify this timer
>>>>>>> > which is got set .....
>>>>>>>
>>>>>>> > So that, with that id i can call some API which makes the timer to
>>>>>>> > start from that time it was already showing at.....- Hide quoted 
>>>>>>> > text -
>>>>>>>
>>>>>>> - Show quoted text -
>>>>>>
>>>>>>
>>>>>> Ya, i did it has
>>>>>>
>>>>>> SetTimer((UINT)&callCounter,1000,
>>>>>> (TIMERPROC)CallCounterDisplayTimerProc);
>>>>>>
>>>>>> the CallCounterDisplayTimerProc() used to increment the time.
>>>>>>
>>>>>> But it is displaying from the beginning i.e. 00:00:00 but not 
>>>>>> starting
>>>>>> from where it was before for Ex: 00:01:30
>>>>>>
>>>>>> May be i think the new timer is getting set.......
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


0
jmarc (108)
4/6/2007 1:39:21 PM
I am a little confused as well.

Maybe you meant this
>> bool MyBussinessObject::ATimerHasElapse(UINT_PTR IDEvent)
>> {
>>     for(i=0; i< many; i++)
>>     {
             CBaseClassObject *pObject = (CBaseClassObject *)IDEvent;
>>         bool m_fDone = pObject->ProcessOnTimer(IDEvent);
>>         if(m_fDone)
>>             return true;
>>     }

but that is could be dangerous in my opinion.

AliR.

"David Wilkinson" <no-reply@effisols.com> wrote in message 
news:etBIrlFeHHA.1312@TK2MSFTNGP03.phx.gbl...
> jmarc wrote:
>
>> bool MyBussinessObject::ATimerHasElapse(UINT_PTR IDEvent)
>> {
>>     for(i=0; i< many; i++)
>>     {
>>         bool m_fDone = OneOfManyObject::ProcessOnTimer(IDEvent);
>>         if(m_fDone)
>>             return true;
>>     }
>>
>>     for(j=0; j< manymore; j++)
>>     {
>>         bool m_fDone = OtherObject::ProcessOnTimer(IDEvent);
>>         if(m_fDone)
>>             return true;
>>     }
>>
>>     return false;
>> }
>>
>> ...........................  this method is the one to look at !!
>> bool OneOfManyObject::ProcessOnTimer(UINT_PTR IDEvent)
>> {
>>     if( IDEvent == this )      // Check if OnTimer() has been called for
>
> jmarc:
>
> You seem very confused about classes and objects. Surely this code cannot 
> compile. You are calling ProcessOnTimer() as if it were a static method, 
> which is cannot be because it uses "this" pointer.
>
> Non-static methods need an instance and the . or -> operator, not the :: 
> operator.
>
> Or are you using multiple inheritance?
>
> -- 
> David Wilkinson
> Visual C++ MVP 


0
AliR3470 (3236)
4/6/2007 2:59:19 PM
jmarc wrote:

> bool MyBussinessObject::ATimerHasElapse(UINT_PTR IDEvent)
> {
>     for(i=0; i< many; i++)
>     {
>         bool m_fDone = OneOfManyObject::ProcessOnTimer(IDEvent);
>         if(m_fDone)
>             return true;
>     }
> 
>     for(j=0; j< manymore; j++)
>     {
>         bool m_fDone = OtherObject::ProcessOnTimer(IDEvent);
>         if(m_fDone)
>             return true;
>     }
> 
>     return false;
> }
> 
> ...........................  this method is the one to look at !!
> bool OneOfManyObject::ProcessOnTimer(UINT_PTR IDEvent)
> {
>     if( IDEvent == this )      // Check if OnTimer() has been called for 

jmarc:

You seem very confused about classes and objects. Surely this code 
cannot compile. You are calling ProcessOnTimer() as if it were a static 
method, which is cannot be because it uses "this" pointer.

Non-static methods need an instance and the . or -> operator, not the :: 
operator.

Or are you using multiple inheritance?

-- 
David Wilkinson
Visual C++ MVP
0
no-reply8010 (1791)
4/6/2007 3:40:22 PM
This is not a real code.  Of course,
It will not compile.  I wrote it on
the fly.  You're right, replacing :: by ->
and adding brackets to reach objets
instances... might be better, and
more understandable..

I assure you, I am well aware of
classes and objects, and static method
as well..

Now, the whole example again...
________________________________________________
void CMyWnd::OnTimer(UINT_PTR IDEvent)
{
    if( MyBussinessObject::ATimerHasElapse(IDEvent) )
        return;
    else
        CWnd::OnTimer(nIDEvent);
}


bool MyBussinessObject::ATimerHasElapse(UINT_PTR IDEvent)
{
    for(i=0; i< many; i++)
    {
        if(pOneOfManyObject[i]->ProcessOnTimer(IDEvent))
            return true;
    }

    for(j=0; j< manymore; j++)
    {
        if( pOtherObject[j]->ProcessOnTimer(IDEvent) )
            return true;
    }

    return false;
}

............................  this method is the one to look at !!
bool OneOfManyObject::ProcessOnTimer(UINT_PTR IDEvent)
{
    if( IDEvent == this )   // Check if this timer is related this object
    {                // Windows OnTimer() returns the id to do this kind of 
match
        ... do some process
        ... calculate another time value, or having to stop it...

        if(m_fAgain)
            StartTimer(this, m_NewTimeValue);   // Throw the timer again...
        else
            KillTimer(this); // This object doesn't need a timer anymore, 
stop
        return true;           // Indicating the owner of the timer has been 
found
    }
    else
        return false;          // Indicating this object is not the owner.
}
..............................
________________________________________________

jmarc...




"David Wilkinson" <no-reply@effisols.com> wrote in message 
news:etBIrlFeHHA.1312@TK2MSFTNGP03.phx.gbl...
> jmarc wrote:
>
>> bool MyBussinessObject::ATimerHasElapse(UINT_PTR IDEvent)
>> {
>>     for(i=0; i< many; i++)
>>     {
>>         bool m_fDone = OneOfManyObject::ProcessOnTimer(IDEvent);
>>         if(m_fDone)
>>             return true;
>>     }
>>
>>     for(j=0; j< manymore; j++)
>>     {
>>         bool m_fDone = OtherObject::ProcessOnTimer(IDEvent);
>>         if(m_fDone)
>>             return true;
>>     }
>>
>>     return false;
>> }
>>
>> ...........................  this method is the one to look at !!
>> bool OneOfManyObject::ProcessOnTimer(UINT_PTR IDEvent)
>> {
>>     if( IDEvent == this )      // Check if OnTimer() has been called for
>
> jmarc:
>
> You seem very confused about classes and objects. Surely this code cannot 
> compile. You are calling ProcessOnTimer() as if it were a static method, 
> which is cannot be because it uses "this" pointer.
>
> Non-static methods need an instance and the . or -> operator, not the :: 
> operator.
>
> Or are you using multiple inheritance?
>
> -- 
> David Wilkinson
> Visual C++ MVP 


0
jmarc (108)
4/6/2007 4:12:41 PM
Yes..

Check out my other post, with the
reworked code..

I often use "this" as a simple and free
ID to be passed to others objects, that
have to recognize wich are calling,

In many design I have made, as right now,
some objects requires subscription, with
an ID, to have some context in subsequent
calls to them. For an object "this" is unique,
and for an application, we have as many as
we need, without declaring them! (it's free).

Just like KillTimer(id) who require something
from the owner to point to the right timer
instance...

Like I said, just another way to do someting...
Not really dangerous at all!

jmarc...



"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
news:khtRh.2992$H_5.1279@newssvr23.news.prodigy.net...
>I am a little confused as well.
>
> Maybe you meant this
>>> bool MyBussinessObject::ATimerHasElapse(UINT_PTR IDEvent)
>>> {
>>>     for(i=0; i< many; i++)
>>>     {
>             CBaseClassObject *pObject = (CBaseClassObject *)IDEvent;
>>>         bool m_fDone = pObject->ProcessOnTimer(IDEvent);
>>>         if(m_fDone)
>>>             return true;
>>>     }
>
> but that is could be dangerous in my opinion.
>
> AliR.
>
> "David Wilkinson" <no-reply@effisols.com> wrote in message 
> news:etBIrlFeHHA.1312@TK2MSFTNGP03.phx.gbl...
>> jmarc wrote:
>>
>>> bool MyBussinessObject::ATimerHasElapse(UINT_PTR IDEvent)
>>> {
>>>     for(i=0; i< many; i++)
>>>     {
>>>         bool m_fDone = OneOfManyObject::ProcessOnTimer(IDEvent);
>>>         if(m_fDone)
>>>             return true;
>>>     }
>>>
>>>     for(j=0; j< manymore; j++)
>>>     {
>>>         bool m_fDone = OtherObject::ProcessOnTimer(IDEvent);
>>>         if(m_fDone)
>>>             return true;
>>>     }
>>>
>>>     return false;
>>> }
>>>
>>> ...........................  this method is the one to look at !!
>>> bool OneOfManyObject::ProcessOnTimer(UINT_PTR IDEvent)
>>> {
>>>     if( IDEvent == this )      // Check if OnTimer() has been called for
>>
>> jmarc:
>>
>> You seem very confused about classes and objects. Surely this code cannot 
>> compile. You are calling ProcessOnTimer() as if it were a static method, 
>> which is cannot be because it uses "this" pointer.
>>
>> Non-static methods need an instance and the . or -> operator, not the :: 
>> operator.
>>
>> Or are you using multiple inheritance?
>>
>> -- 
>> David Wilkinson
>> Visual C++ MVP
>
> 


0
jmarc (108)
4/6/2007 8:44:59 PM
My fault!.

Forget this piece of code.  It was
just to sustain an explanation of
how to use the 'this' pointer as a
good ID for MFC timers...

The origin of this thread was what
can be an ID to pass to SetTimer....

jmarc...


"David Wilkinson" <no-reply@effisols.com> wrote in message 
news:eggBDpIeHHA.1244@TK2MSFTNGP04.phx.gbl...
> jmarc wrote:
>
>> This is not a real code.  Of course,
>> It will not compile.  I wrote it on
>> the fly.  You're right, replacing :: by ->
>> and adding brackets to reach objets
>> instances... might be better, and
>> more understandable..
>>
>> I assure you, I am well aware of
>> classes and objects, and static method
>> as well..
>>
>> Now, the whole example again...
>> ________________________________________________
>> void CMyWnd::OnTimer(UINT_PTR IDEvent)
>> {
>>     if( MyBussinessObject::ATimerHasElapse(IDEvent) )
>>         return;
>>     else
>>         CWnd::OnTimer(nIDEvent);
>> }
>
> jmarc:
>
> I can assure you that posting code that clearly will not compile is 
> extremely distracting to anybody who might try to help you. Why not post 
> the actual code?
>
> So CMyWnd::OnTimer() and MyBussinessObject::ATimerHasElapse() are static 
> methods?
>
> I am still not clear how your classes are related to each other, or how 
> the timers are launched.
>
> But I have to say that I have lost track of the actual question here.
>
> -- 
> David Wilkinson
> Visual C++ MVP 


0
jmarc (108)
4/6/2007 8:59:25 PM
jmarc wrote:

> This is not a real code.  Of course,
> It will not compile.  I wrote it on
> the fly.  You're right, replacing :: by ->
> and adding brackets to reach objets
> instances... might be better, and
> more understandable..
> 
> I assure you, I am well aware of
> classes and objects, and static method
> as well..
> 
> Now, the whole example again...
> ________________________________________________
> void CMyWnd::OnTimer(UINT_PTR IDEvent)
> {
>     if( MyBussinessObject::ATimerHasElapse(IDEvent) )
>         return;
>     else
>         CWnd::OnTimer(nIDEvent);
> }

jmarc:

I can assure you that posting code that clearly will not compile is 
extremely distracting to anybody who might try to help you. Why not post 
the actual code?

So CMyWnd::OnTimer() and MyBussinessObject::ATimerHasElapse() are static 
  methods?

I am still not clear how your classes are related to each other, or how 
the timers are launched.

But I have to say that I have lost track of the actual question here.

-- 
David Wilkinson
Visual C++ MVP
0
no-reply8010 (1791)
4/6/2007 9:30:00 PM
Is jmarc lucky?

I think I see what is going on.

>SetTimer((UINT)&callCounter,1000, (TIMERPROC)CallCounterDisplayTimerProc);
>the CallCounterDisplayTimerProc() used to increment the time.
>But it is displaying from the beginning i.e. 00:00:00 but not starting
>from where it was before for Ex: 00:01:30

However you are updating time I suspect that is what the problem is.
It has nothing to do with Timers.

Where is CallCounterDisplayTimerProc?
How is that being updated?

I suspect that is where the problem is, because CallCounterDisplayTimerProc 
is being called
with every timer you are using.
Unless you have a different callback function for each one for each of your 
timers, or are using some kind of switch statement?
I don't know if you are resetting the time,  or Calling SystemTime, etc?

I think it is very inventive on how you are using the pointer value as the 
ID.
Thanks for that insight.

I played around just to use a callback function.
the dwTimer never starts off at 0. It starts off at 1765984 or something 
odd.
dwTime [in] Specifies the number of milliseconds that have elapsed since the 
system was started. This is the value returned by the GetTickCount function.
How you format it to 00:00:00 I have no idea.

P.S. I noticed this when checkout data types.
#if defined(_WIN64)
 typedef unsigned __int64 UINT_PTR;
#else
 typedef unsigned int UINT_PTR;
#endif
REF: http://msdn2.microsoft.com/en-us/library/aa383751.aspx

HTH,


0
Nobody530 (222)
4/6/2007 9:34:26 PM
P.S. If I am totally offbase kindly disregard. Sorry for the intrusion.
I'm just investigating the Timer Callback.
I've never had to use callbacks.

I also noticed something else that may be of interest.
I don't believe that OnTimer works with the Callback function.
I believe you have to use one or the other. I tried it and it is not 
working.
I see both being used, so I thought I would point that out as well.

>SetTimer((UINT)&callCounter,1000, (TIMERPROC)CallCounterDisplayTimerProc);

>void CMyWnd::OnTimer(UINT_PTR IDEvent)
>{
>    if( MyBussinessObject::ATimerHasElapse(IDEvent) )
>        return;
>    else
>        CWnd::OnTimer(nIDEvent);
>}


HTH,


0
Nobody530 (222)
4/7/2007 2:30:13 AM
UINT_PTR is not a type of an object reference.  UINT_PTR is an integer value which happens
to be large enough to hold a pointer, but it is NOT intrinsically a reference to anything.
This is done to support 64-bit Windows where 64-bit values are often expected.

With a callback function, as already pointed out, an ID is assigned, and the value passed
as the UINT_PTR parameter is ignored.
					joe

On Thu, 05 Apr 2007 18:39:32 GMT, "jmarc" <jmarc@incursion-voyages.com> wrote:

>Well said AliR, about all the
>details..
>
>UINT_PTR is the type of an
>object reference.  So, for an object
>instance, the programmer can simply
>use the object reference ' this ' to
>give to the function.  This will correctly
>identify the timer instance without
>having to memorize the ID somewhere..
>
>jmarc..
>
>
>"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message 
>news:MA8Rh.1522$w41.820@newssvr19.news.prodigy.net...
>>I think you misunderstood how to use SetTimer.  The first parameter is not 
>>a pointer to a UINT.  It's just a UINT. I don't really know why Microsoft 
>>came up with UINT_PTR.
>> #define UINT_PTR UINT
>>
>> Any way the first parameter is the ID you want to give the timer 100, 101, 
>> 1000, it really doesn't matter what the number is.  Now that is the number 
>> that will be use to stop the timer.
>>
>> for Example
>> SetTimer(100,1000,NULL);  //this will set a timer which will send a 
>> WM_TIMER message every 1 second.
>>
>> If you want to kill this timer
>> KillTimer(100);
>>
>> Now if you want to use SetTimer's callback functionality then you ignore 
>> the first parameter all together. SetTimer will return an ID for the timer 
>> you just created.
>>
>> m_TimerID = SetTimer(0,1000, CallCounterDisplayTimerProc);
>>
>> and when you want to kill this timer you have to call
>> KillTimer(m_TimerID);
>>
>> Now if you want to reset what you display to zero, then simply set the 
>> value that you increment every time the timer hits to zero.
>>
>> AliR.
>>
>>
>>
>>
>>
>>
>>
>>
>> "lucky" <Laxmanmaruthy@gmail.com> wrote in message 
>> news:1175781625.627437.48340@n76g2000hsh.googlegroups.com...
>>> On Apr 5, 6:18 pm, "Mubashir Khan" <m...@yahoo.com> wrote:
>>>> isnt it the same id u called SetTimer with ....."lucky" 
>>>> <Laxmanmaru...@gmail.com> wrote in message
>>>>
>>>> news:1175778268.053331.256800@o5g2000hsb.googlegroups.com...
>>>>
>>>>
>>>>
>>>> > Hi,
>>>>
>>>> > I have a dialog on which the timer is displayed using SetTimer() which
>>>> > is binded to the dialog.Is there any API  that identify this timer
>>>> > which is got set .....
>>>>
>>>> > So that, with that id i can call some API which makes the timer to
>>>> > start from that time it was already showing at.....- Hide quoted 
>>>> > text -
>>>>
>>>> - Show quoted text -
>>>
>>>
>>> Ya, i did it has
>>>
>>> SetTimer((UINT)&callCounter,1000,
>>> (TIMERPROC)CallCounterDisplayTimerProc);
>>>
>>> the CallCounterDisplayTimerProc() used to increment the time.
>>>
>>> But it is displaying from the beginning i.e. 00:00:00 but not starting
>>> from where it was before for Ex: 00:01:30
>>>
>>> May be i think the new timer is getting set.......
>>>
>>>
>>>
>>
>> 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
4/13/2007 3:08:19 AM
Reply:

Similar Artilces:

Problems with creating a newsletter
I chose the form "Newsletter - email". I have created a 3 page newsletter. Now, I have NO IDEA how to send it out as an email. I do not want to send it as an attachment. I cannot figure out which "save as" format or what I need to do so that i can email this newsletter. Is there a website that goes through how to do this? Am I correct when I say that it has to be html in order for me to send it as email? That is not one of the options. Any help you give me would be greatly appreciated. Thank you, Markis www.adreamforabetterworld.com ...

Meeting updates #2
My users cannot update meetings created when they were on the old email server. I have noticed that the old string is still mapped to the meeting. e.g x400;c=us;a= ;p=Org name;o=exchagne;s=Lastname;g=firstname; Take a look at the following article: 275134 XADM: Cannot Reply to Messages That Are Sent from a User Account That http://support.microsoft.com/?id=275134 The same thing applies to meetings. How did you move them and what version(s) of Exchange? Thanks, Richard Roddy Microsoft Exchange Support This posting is provided "AS IS" with no warranties, and confers no ri...

Changing SQL Server for CRM 1.2
As my SQL server is currently on its last breath I am in the process of moving our CRM 1.2 databases to a new dedicated serever. I have detatched the databases from the old server, copied the files to the server and attached them. I have then gone into CRM deployment manager and changed to the SQL server to the new server. That all appears to work fine, no error messages. But when users try to access the CRM system they get an error and the CRM server event log fills with error messages. A few are listed below: dmLog: Failed to execute the SQL batch in the file sqlbatch.sql. MSCRM P...

How do you turn off/on the "1" or "2" or "+" or "-" view hide/unh.
What is or how do you control, turn on/off the small "1" "2" or "+" "-" hide/unhide view buttons right above the "A" cell? Sometimes shows when I hide columns. Hi 'Data - Goup/Outline' -- Regards Frank Kabel Frankfurt, Germany Seth wrote: > What is or how do you control, turn on/off the small "1" "2" or "+" > "-" hide/unhide view buttons right above the "A" cell? Sometimes > shows when I hide columns. You can toggle them to hide or display with <Ctrl> <8> Usi...

I cannot get the pictures to show on screen in Publisher web previ
I have tried embedding and linked but nothing seems to work. Do I have to apply a master page? It is to be a one page web site. This is probably so basic but I am trying to teach myself how to use it. What do I have to do to have them show in preview and once uploaded? Thank you. Are you using FireFox to preview or IE? DavidF "rendul" <rendul@discussions.microsoft.com> wrote in message news:C9B0A640-6C87-4E9A-8A0E-5F32F7DAC0DE@microsoft.com... >I have tried embedding and linked but nothing seems to work. Do I have to > apply a master page? It is to be a one ...

Steps to Share Outlook on 2 different drives
This is a problem created by a dual boot of XPPSP2 on one drive C:\ and Vista on another drive E:\ that I use to format for new builds of Vista on the same box. I want to take my Outlook 2003 in box and folders on two different drives on one box and combine them so that all the emails go to one account and all the folders can be shared or used on each drive. I want to do the same with Outlook Express as well, and since this is an *Outlook newsgroup, I'll just take what I learn here and apply it to the ..dbx folder(s) in it. The idea is to receive email on both drives in one in one...

printing 2 charts on single page
Using Excel 2k, Win 2k I was trying to print to line charts on a single page to demonstrate the corelation between the two data sets. I would like to print in portait mode with one chart on top of page and one on bottom. Excel only seems to offer putting chart 2 on a separate page or embedding it in chart one. I am not very familiar with excel charting capabilites can anyone suggest a resorce? Thanks ...

Offline folder problems #2
Hi Guys, Basically I installed Outlook 97 on my office PC which is connect to microsoft exchange server. For some reason all of my messages were copied into offline folders, this causes a problem, whenever I open up outlook I get this message. Upload of offline changes could not be completed you do not have sufficient permission to perform this operation on this object. See the folder contact or see your system administrator. I do not administrator access on my user profile, every time I open outlook it resets everything I have changed (view etc) and gives that error message. How ...

Receiving Transaction Entry #2
I went into Receiving Transaction Entry to record the receipt of an item. The invoiced price did not agree with the purchase order. I had to add Shipping and adjust the provincial tax. I went to the proper screen to over-ride the calculated tax and the system told me that I couldn't do that because I had not filled in all the BOLD, RED areas. At that point I wanted to close down that screen, but the system would not let me do that either. I could minimize the screen and then I could also see that there wasn't any required information that had not be entered. The only way I c...

Getting the BCC field by default.
I would like the BCC field to show by default but cannot find the setting for this in 2007. Anyone know where this is located? In a new message window, use the Options chunk to display the "Show BCC." --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, JC HARRIS asked: | I would like the BCC field to show by default but cannot find the | setting for this in 2007. Anyone know where this is located? Thanks Milly. I had...

Opening pub files created with older Publisher versions #2
I have just upgraded to Publisher 2003 from 2000 and am having trouble with pub files sent to me for our chuch newsletter which is using Publisher 97 The text is not wrapping around graphics boxes. Can I fix this? I really don't want to go back to Pub 200 Thank Richard this is caused by Publisher 97 not been printer independent. Even if you went back to Publisher 2000, unless you have the identical font versions and printer driver you would have issues with formatting. It sounds like the person sending you the file has a garbage HP inkjet printer. Get them to install the HP5P laser p...

Associating Multiple Existing Contacts to an Account, Until CRM 2.x
I have racked my pea-sized brain for endless days for a way to associate multiple existing contacts (or accounts) to an account. My client has accounts that have many contacts (or accounts) involved at different stages of acquiring a new account. The logical method would be to add a custom attribute with lookup functionality into the existing CRM contact or account objects but this is not possible with CRM 1.x. The resulting UI would allow an end user to associate different contacts (or accounts) to an account. Example: Account: ABC - AccountPhysician: (existing account or con...

VCard issue #2
This is a weird problem, but when I send a vcard to someone, it shows up in my sent items as a vcf file, and has a vcard icon on it, but when the recipient gets the VCard, it shows up as msg file, with an envelope icon as the attachment. When I open it, nothing is there - it's empty. I can't find anything regarding this problem on google or MS's website. Anybody have any ideas? Is it a problem with Outlook? Do I need to do a detect and repair, a reinstallation? Thanks for your help! Does the same happen when you send a message to yourself? Is he/she able to see it w...

Some Excel formatting functions taking a long time to work #2
Excel 2000 SP3 When I use some formatting functions for the first time in a session, such as bold, increasing font size etc, it takes up to 30 seconds to work. Meantime Excel is locked up until it completes that formatting call. I suspect faulty DLL? Has anyone experienced this? How to fix (other than a complete re- install) ? Any advice appreciated. Piri On Nov 5, 8:39=A0am, Piri <wiremu.pare...@hotmail.com> wrote: > Excel 2000 SP3 > When I use some formatting functions for the first time in a > session, such as bold, increasing font size etc, it takes =A0up to 30 > secon...

2 Domains, 1 Exchange Server
Hi, We're trying to go with 2 seperate 2003 domains, but with only one Exchange 2003 Server. What would be needed for the domain that the Exchange server is not in to access e-mail? We've contemplated having those users use OWA, but would really like them to be able to use Outlook 2003. We're a school district and want to segregate the kids domain from the administration domain, but only have funding for one Exchnage server. Any ideas\help will be appreciated. TIA. Hi, This should explain what it requires: http://support.microsoft.com/?id=278888 Leif "tj woo...

Creating a Macro to Delete Commas #2
I have an excel file that the size will varry. I need a macro that will check all the fields for a comma. If there is one I would like to get rid of it. Does anyone have any idea how to do this? I have no idea and I have been assigned this task. Help --- Message posted from http://www.ExcelForum.com/ No macro required. ctrl-H for find/replace. find , replace nothing (leave the replace field blank). You can of course record that within a macro if you wish. Drabbacs >-----Original Message----- >I have an excel file that the size will varry. I need a macro that will >check ...

how do I import my contacts from IncrediMail 2.0 to MOutlook2007
I am new to using microsoft outlook 2007 and am searching for a way to upload my contact list, from Incredimail 2.0 to Outlook 2007. Any help would be definitely appreciated, thanks! How do I save my IncrediMail Address Book and move it to a different location? http://help.incredimail.com/incredimail/help_center/help_article.aspx?is=t&article_id=67&lang_id=9 In Outlook - File --> Import and Export ... import the CSV file created via process noted above Karl -- ____________________________________________________________ Karl Timmermans - The Claxton Group Co...

Money 2004 Debt Planner #2
When trying to add a loan to the debt planner, Money keeps telling me that I am 6 months past due on this particular loan. In reality, I have made consistent entries for each month's payment. This is making it really difficult to use the debt planner! What do I need to do? ...

Indirect Method for Name Box Variable? #2
DARN The reason I want to do this is that I have to collect data on a dail basis but I have to display it on a graph on a weekly basis. I select the entire week of cells and give it a name like week52. The following week I have to select the entire week and name i week53. Everything is set up that I can just copy and the numbers will progres for whatever length of time I need to graph (months, years, etc) excep this. Maybe I'll just go back to using the range of cell numbers. Thanks guys -- Chris Brenna ----------------------------------------------------------------------- Chris Bre...

80070005 error #2
I am getting this error when trying to view public folder property from system manager. My issue is same as what you can find out from http://forums.msexchange.org/ultimatebb.cgi? ubb=get_topic;f=19;t=000114 Anyone has a clue? ...

How do I insert space between 2 consecutive columns of an XL Shee.
I want to have space between two consecutive columns of a worksheet (of course, without having inserted another column between the two) in order to have separated the Border Lines of the adjacent cells/columns. Please guide me if it can be done in XL. Can you achieve the effect that you're looking for by using a double vertical border down the right side of the left column and having no border down the left side of the right column? Rgds, ScottO "Shamshad Butt" <Shamshad Butt@discussions.microsoft.com> wrote in message news:1222EE13-11A9-4354-9F12-D1F1155D3902@microsof...

RMS 1.2 vs 1.3, plus integrate with Great Plains
1.) I am working on an assessment for upgrading our current RMS software from 1.2 to 1.3. My assessment will take in account the benefits, broken down by store operations (Retail) and the benefits to IT. Also, list risks and potential problems that might be experienced. We currently have 28 stores with 3+ registers per location with another 22 new stores on the schedule over the next 2 years. Are their other in this group of similiar size that have done this upgrade to the new version? 2.) If we do not upgrade the software, can we still integrate the RMS to Great Plains? Would we...

Getting rid of selection
How can I get rid of the selection rectangle? It seems that it's always there, with a heavy black rectangle, or there's a light black rectangle marking where it was. I'm trying to get rid of it altogether, so I can capture an image of the sheet for use in a webpage. I can achieve the effect that I want by selecting a cell which is outside the area that I'm trying to capture, but now that I've found that I cannot get rid of it entirely, it is driving me nuts trying to do so. -- Steve Swift http://www.swiftys.org.uk/swifty.html http://www.ringers.org.uk You could al...

HQ Licensing question V.2
I have a client running HQ client at 8 stores + HQ server at the warehouse. They would like to be able to use transfers from the warehouse to the stores, so I would have to setup a new PC running Store Ops and a new database, however, in order for the transfers to take place, I need a HQ Client License correct? Do I also need a POS key? I appreciate any insights you may have. Thanks in advance Hi Phil yes - you'll need an HQ Client license so it can exchange with your headquarters - "export" the wh database as you would any store from HQ no - you won't need a PO...

CRM Email Displays Size=2>
One of my users is experiencing an issue when they save an email that is tracked within CRM the email displays in CRM with "Size=2>" directly in front of certain lines of the email. So for example "Size=2>" will appear in front of someone's comments in the email or in front of their name. Does anyone know why "Size=2>" is displaying in front of the lines of an email? Thanks. Mike H. "Mike H." wrote: > One of my users is experiencing an issue when they save an email that is > tracked within CRM the email displays in CRM wit...