Click here to Skip to main content
15,888,286 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Sleep less than 1 ms Pin
Adnan Merter6-Jan-10 4:11
Adnan Merter6-Jan-10 4:11 
GeneralRe: Sleep less than 1 ms Pin
Luc Pattyn6-Jan-10 4:24
sitebuilderLuc Pattyn6-Jan-10 4:24 
GeneralRe: Sleep less than 1 ms Pin
Emilio Garavaglia6-Jan-10 21:02
Emilio Garavaglia6-Jan-10 21:02 
GeneralRe: Sleep less than 1 ms Pin
Adnan Merter7-Jan-10 8:38
Adnan Merter7-Jan-10 8:38 
GeneralRe: Sleep less than 1 ms Pin
Emilio Garavaglia7-Jan-10 19:58
Emilio Garavaglia7-Jan-10 19:58 
AnswerRe: Sleep less than 1 ms Pin
softwaremonkey6-Jan-10 11:49
softwaremonkey6-Jan-10 11:49 
GeneralRe: Sleep less than 1 ms Pin
Adnan Merter7-Jan-10 8:36
Adnan Merter7-Jan-10 8:36 
GeneralRe: Sleep less than 1 ms Pin
Adnan Merter7-Jan-10 9:53
Adnan Merter7-Jan-10 9:53 
i found this and it works fine, there is no problem so far but i cant how to set the timer less time periods and the ms is accurate ms here?

#include <windows.h>
#include <process.h>
#include <stdio.h>

unsigned __stdcall TF(void* arg) {
  HANDLE timer=(HANDLE) arg;

  while (1) {
    WaitForSingleObject(timer,INFINITE);
    printf(".");
  }

}

int main(int argc, char* argv[]) {

  HANDLE timer = CreateWaitableTimer(
    0,
    false, // false=>will be automatically reset
    0);    // name

  LARGE_INTEGER li;

  const int unitsPerSecond=10*1000*1000; // 100 nano seconds

  // Set the event the first time 2 seconds
  // after calling SetWaitableTimer

  li.QuadPart=-(2*unitsPerSecond);
  SetWaitableTimer(
    timer,
    &li,
    750,   // Set the event every 750 milli Seconds
    0,
    0,
    false);

  _beginthreadex(0,0,TF,(void*) timer,0,0);

  // Wait forever, 
  while (1) ;

  return 0;
}


--always comes daylight after night-----

GeneralRe: Sleep less than 1 ms Pin
softwaremonkey7-Jan-10 11:32
softwaremonkey7-Jan-10 11:32 
QuestionHow to send a msg between MainFrame and a view? Pin
Software20075-Jan-10 5:57
Software20075-Jan-10 5:57 
AnswerRe: How to send a msg between MainFrame and a view? Pin
Richard MacCutchan5-Jan-10 9:31
mveRichard MacCutchan5-Jan-10 9:31 
GeneralRe: How to send a msg between MainFrame and a view? Pin
Software20075-Jan-10 9:51
Software20075-Jan-10 9:51 
GeneralRe: How to send a msg between MainFrame and a view? Pin
Richard MacCutchan5-Jan-10 9:59
mveRichard MacCutchan5-Jan-10 9:59 
GeneralRe: How to send a msg between MainFrame and a view? Pin
Software20075-Jan-10 10:02
Software20075-Jan-10 10:02 
GeneralRe: How to send a msg between MainFrame and a view? Pin
Richard MacCutchan5-Jan-10 10:50
mveRichard MacCutchan5-Jan-10 10:50 
GeneralRe: How to send a msg between MainFrame and a view? Pin
Software20076-Jan-10 2:30
Software20076-Jan-10 2:30 
GeneralRe: How to send a msg between MainFrame and a view? Pin
Richard MacCutchan6-Jan-10 3:48
mveRichard MacCutchan6-Jan-10 3:48 
QuestionRe-drawing Transparent Bitmap - Strange Behavior Pin
softwaremonkey5-Jan-10 5:05
softwaremonkey5-Jan-10 5:05 
AnswerRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
Cedric Moonen5-Jan-10 8:28
Cedric Moonen5-Jan-10 8:28 
GeneralRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
softwaremonkey5-Jan-10 8:42
softwaremonkey5-Jan-10 8:42 
GeneralRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
Cedric Moonen5-Jan-10 9:14
Cedric Moonen5-Jan-10 9:14 
GeneralRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
softwaremonkey5-Jan-10 9:31
softwaremonkey5-Jan-10 9:31 
GeneralRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
Rozis6-Jan-10 10:15
Rozis6-Jan-10 10:15 
GeneralRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
softwaremonkey6-Jan-10 11:39
softwaremonkey6-Jan-10 11:39 
QuestionEditCtrl Pin
kumar sanghvi5-Jan-10 2:27
kumar sanghvi5-Jan-10 2:27 

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.