Click here to Skip to main content
15,916,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Menu with Icons? Pin
toxcct27-Apr-04 7:57
toxcct27-Apr-04 7:57 
AnswerRe: Menu with Icons? Pin
John R. Shaw27-Apr-04 7:35
John R. Shaw27-Apr-04 7:35 
GeneralDSN password and username Pin
skoizumi2911027-Apr-04 6:08
sussskoizumi2911027-Apr-04 6:08 
GeneralRe: DSN password and username Pin
Krugger40427-Apr-04 10:28
Krugger40427-Apr-04 10:28 
GeneralSetting up a timer Pin
Shay Harel27-Apr-04 6:08
Shay Harel27-Apr-04 6:08 
GeneralRe: Setting up a timer Pin
toxcct27-Apr-04 6:14
toxcct27-Apr-04 6:14 
GeneralRe: Setting up a timer Pin
David Crow27-Apr-04 6:42
David Crow27-Apr-04 6:42 
GeneralRe: Setting up a timer Pin
Paul Ranson27-Apr-04 7:56
Paul Ranson27-Apr-04 7:56 
If your 'regular C++ class' represents a Window then you can use ::SetTimer and handle the message. If it doesn't then you could look at ::CreateTimerQueueTimer , which requires W2000 or later but which will regularly call a function for you.
class HasATimerCallback
{
private :
    HANDLE hTimer_ ;

    static  void CALLBACK TimerFunc ( void * param, BOOLEAN bTimer )
    {
        if ( param )
        {
            reinterpret_cast < HasATimerCallback*>( param )->DoTimerFunc () ;
        }
    }
    void DoTimerFunc ()
    {
       // etc
    }
public :
    HasATimerCallback ()
    {
        ::CreateTimerQueueTimer ( &hTimer_,
                                   0,
                                   TimerFunc, // call TimerFunc
                                   this,      // with 'this' as param
                                   60000,     // wait 60 seconds
                                   60000,     // and then every 60 seconds
                                   WT_EXECUTEINTIMERTHREAD // you will have to consider what this should be.
                                   } ;
    }
    ~HasATimerCallback ()
    {
        ::DeleteTimerQueueTimer ( 0, hTimer_, INVALID_HANDLE_VALUE ) ;
    }
} ;


I haven't compiled this, just cut'n'paste from some code I had lying around.

Paul
GeneralRe: Setting up a timer Pin
Shay Harel28-Apr-04 3:59
Shay Harel28-Apr-04 3:59 
GeneralRe: Setting up a timer Pin
Paul Ranson28-Apr-04 23:00
Paul Ranson28-Apr-04 23:00 
GeneralPreprocessor Pin
Alexander M.,27-Apr-04 5:30
Alexander M.,27-Apr-04 5:30 
GeneralRe: Preprocessor Pin
toxcct27-Apr-04 5:55
toxcct27-Apr-04 5:55 
GeneralRe: Preprocessor Pin
Alexander M.,28-Apr-04 2:38
Alexander M.,28-Apr-04 2:38 
GeneralRe: Preprocessor Pin
David Crow27-Apr-04 10:01
David Crow27-Apr-04 10:01 
GeneralRe: Preprocessor Pin
toxcct27-Apr-04 23:20
toxcct27-Apr-04 23:20 
GeneralRe: Preprocessor Pin
Paul Ranson28-Apr-04 0:43
Paul Ranson28-Apr-04 0:43 
GeneralRe: Preprocessor Pin
Alexander M.,28-Apr-04 2:37
Alexander M.,28-Apr-04 2:37 
GeneralRe: Preprocessor Pin
David Crow29-Apr-04 3:11
David Crow29-Apr-04 3:11 
GeneralRe: Preprocessor Pin
Paul Ranson30-Apr-04 1:26
Paul Ranson30-Apr-04 1:26 
GeneralRe: Preprocessor Pin
David Crow29-Apr-04 3:08
David Crow29-Apr-04 3:08 
GeneralHelp needed: Swapping large data sets to file Pin
f.o.b27-Apr-04 4:56
f.o.b27-Apr-04 4:56 
GeneralRe: Help needed: Swapping large data sets to file Pin
f6427-Apr-04 6:14
f6427-Apr-04 6:14 
GeneralCharge Images from a PATH Pin
Hugo_Javier_Bertorello27-Apr-04 4:52
Hugo_Javier_Bertorello27-Apr-04 4:52 
GeneralRe: Charge Images from a PATH Pin
David Crow27-Apr-04 5:38
David Crow27-Apr-04 5:38 
GeneralRe: Charge Images from a PATH Pin
PJ Arends27-Apr-04 7:00
professionalPJ Arends27-Apr-04 7:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.