|
-
Apr 15th, 2000, 11:37 PM
#1
Thread Starter
transcendental analytic
This is only a part of my project, but it's one heck important one. I use bitblt to scroll the form content from right to left. Using the timer, it goes to slow so I put it in an infinite loop (that exits on unload attemt). But this hang up everything in this order: Mouseclick not responing, Keybord not responding, Winamp stops playing, Mouse don't move, beeping when moving mouse/keybord(sometimes). I press reset.
Ok this isn't a nice scenario, but then I put a for next with 10 instead of the infinite loop and it will hang up for about 20 seconds. Slowly starting to run again. (only if you have time to unload it.
Code:
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Sub Form_Unload(Cancel As Integer)
If UnloadSequence < 2 Then UnloadSequence = 1: Cancel = 1
End Sub
Private Sub Timer2_Timer()
Timer2.Enabled = False
Do
BitBlt hDC, 0, 0, ScaleWidth, ScaleHeight, hDC, TextWidth("O") / 15 / 10, 0, vbSrcCopy
DoEvents
Loop Until UnloadSequence
UnloadSequence = 2
Unload Me
End Sub
Ok, people! I want a way to use bitblt as fast as possible without having this kind of problems. Any ideas?
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.
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
|