Idle functions

Hello

I wonder how to implement an idle function I searched the SDK but couldn't find any appropriate functions. I only found .net Application.Idle but since I don't use .net it's not for me. Could anyone please give me some pointers

Many thanks,

Martin Malek



Answer this question

Idle functions

  • John05

    Thanks Avinash

    I'm not familiar with MFC. I'm currently in a native C++ Smartphone project and I'm not able to find any references to WM_IDLE in the SDK. Any way for me to use MFC with my Smartphone project

    Many thanks,

    Martin Malek



  • hemo

    Not sure what you mean by "idle" function. Perhaps Sleep() would do You can call it with 0 to release CPU time.



  • SterlingH

    Ilya

    Sorry for not being clear enough. What I need is an idle message to be sent via the message pump whenever the application is not doing any work.

    Perhaps I should implement it as a callback and have it sending messages allways in a certain intervall

    / Martin Malek



  • Vani M

    Hi Avinash

    I tried using WM_TIMER together with SetTimer but for some reason my application never enters the WM_TIMER case. Perhaps it's too busy.

    I'l try to look in to this a bit more.

    Thanks for your help,

    Martin Malek


  • briggins5

    Before you know how to create MFC projects etc. you need to decide whether you want to use MFC or not. If your app is about controls/UI interaction like stuff you shall be better off using MFC, but if its a simple console application that has no UI interaction then probably MFC isn't a natural candidate for use. I don't have enough data here for this decision. Even in that case you may need to consider the cost of such as change, as you said you aren't familiar with MFC.

    You may find this useful http://msdn.microsoft.com/library/default.asp url=/library/en-us/vccore98/HTML/_core_idle_loop_processing.asp

    Coming back to how you use it; you can create a small wizard generated application by going through New Project> Visual C++ > Smart Device > MFC Smart Device Application.

    Thanks.



  • hawash

    For MFC you can handle the WM_IDLE message, which gets dispatched for non modal windows whenever we don't have any message to pump.

    Hope this helps.
    Thanks


  • Idle functions