I need to know how to pause for a second or two, and wait for the user to press "any key" to continue. Also Kedaman maybe after I devote some time to C++ and get all the basics down could you give me an example of DMA?
Printable View
I need to know how to pause for a second or two, and wait for the user to press "any key" to continue. Also Kedaman maybe after I devote some time to C++ and get all the basics down could you give me an example of DMA?
how did you know i was going to read this thread? :p to pause 2 milliseconds you call sleep(2000); and to wait for a key to be pressed buffer the states from getkeyboardstate and compare them. I have some samples of DMA i think you would like ;)
I knew because you can't resist me :D.
VB causes much hilarity among Cam, compared to C++ ;). I just started learning it and now wonder why I put it off for 3 years :confused:!!
And also I'd like to know how to get the current time, I want to find out how long it took to do something (eg, in vb: )
VB Code:
A = Timer B = Timer TimeSec = (B - A) / 1000
How would I do this in C++? I am thinking:
I know GetTime() is probably wrong but is there anything else wrong? IM ON MY 2ND DAY OF C++ PROGRAMMING.Code:long int a, b, c;
a == gettime();
// stuff
b == gettime();
c == (b - a) / 1000;
Also what header files do what? I need to know which one sleep(); is in.
Sleep is an API. So you need to include the windows.h header.
gettickcount() gives you milliseconds from start if that's what you need. all win32api's should be available if you include the windows.h file
ALL APIS????
SWEETNESS!!
I'm beginning to C why C++ is an industry standard.
I'm REALLY sorry for the bad joke.
Well, not ALL APIs... just the most common ones.... nearly anything requiring an OCX in VB will require another header(commctrl.h, wsock.h, etc.)
those are not part of win32api either :p
Well, they are APIs, and he said "ALL APIS????"
Winsock, Common Controls, they're all part of the Win32 API ;)