|
-
Jun 26th, 2001, 10:14 PM
#1
Thread Starter
Good Ol' Platypus
Waiting for Input, Waiting for # milliseconds, DMA in C++
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?
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jun 27th, 2001, 02:37 PM
#2
transcendental analytic
how did you know i was going to read this thread? 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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 27th, 2001, 03:32 PM
#3
Thread Starter
Good Ol' Platypus
-
Jun 27th, 2001, 03:35 PM
#4
Thread Starter
Good Ol' Platypus
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:
Code:
long int a, b, c;
a == gettime();
// stuff
b == gettime();
c == (b - a) / 1000;
I know GetTime() is probably wrong but is there anything else wrong? IM ON MY 2ND DAY OF C++ PROGRAMMING.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jun 27th, 2001, 03:38 PM
#5
Thread Starter
Good Ol' Platypus
Also what header files do what? I need to know which one sleep(); is in.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jun 27th, 2001, 03:40 PM
#6
Frenzied Member
Sleep is an API. So you need to include the windows.h header.
-
Jun 27th, 2001, 03:45 PM
#7
transcendental analytic
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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 27th, 2001, 03:48 PM
#8
Thread Starter
Good Ol' Platypus
ALL APIS????
SWEETNESS!!
I'm beginning to C why C++ is an industry standard.
I'm REALLY sorry for the bad joke.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jun 27th, 2001, 03:56 PM
#9
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.)
-
Jun 27th, 2001, 04:08 PM
#10
transcendental analytic
those are not part of win32api either
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 27th, 2001, 04:20 PM
#11
Well, they are APIs, and he said "ALL APIS????"
-
Jun 27th, 2001, 04:41 PM
#12
Monday Morning Lunatic
Winsock, Common Controls, they're all part of the Win32 API
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|