-
Jul 30th, 2015, 12:30 PM
#1
Thread Starter
Frenzied Member
-
Aug 1st, 2015, 08:23 AM
#2
Re: Windows 7 compatibility mode
Originally Posted by georgekar
I notice that when I use in vb6 program (M2000.exe) combatibility mode (anyone, including Wimdows 7 in a Widnows 7 system) the speed droped. We need 3.5 more time to do the same loop.
You need to tell us what you mean by "combatibility mode" here. Yes, I know you meant to type "compatibility."
There are tons of appcompat shims. I'm assuming you have not been using ACT (Application Compatibility Toolkit) but instead using some setting in Explorer Properties to select one of the generic grab-bag sets of shims, e.g. "Windows XP Service Pack 2" and so on.
To find out what is in your chosen grab-bag you need to install a recent version of ACT and run the Compatibility Administrator tool. There you can look up the "compatibility mode" to see the list of shims in the grab-bag. You can click on most shims there to get a brief description of what the shim does:
-
Aug 1st, 2015, 08:35 AM
#3
Re: Windows 7 compatibility mode
See: Windows Assessment and Deployment Kit (Windows ADK) for Windows 8.1 Update.
The ACT package is embedded within this larger package now, and it installs into Windows Vista through Windows 8.1 with Update 1.
-
Aug 1st, 2015, 06:09 PM
#4
Thread Starter
Frenzied Member
Re: Windows 7 compatibility mode
The issue here is that using compatibility mode in 7, any, you get a downgrade in speed about to 1/3. So it is not what to use, the best is ..no compatibility mode. But to achieve this I put some peek message calls. With that calls I get 3 times and more faster loops using no compatibility mode.
This is the mystery...Have you dilettante notice something like this? Do you measure the response of your programs to find out what is a better or worst for the goal?
I start with an issue in 7 where in M2000 a loop is running. In version 8 I do some optimizations,and one of them make my day harder. In 7 there is a need to process messages because an internal system analyse the message traffic and deside to inform the user about a non responsing application, making fade to white all screen. This never happen in Xp. So the solutions are two. One is to choose compatibility mode so you loose speed. The second is the use of a Mydoevents using peekmessage.
This is what I want to share but someone deside to move this thread to question lists
-
Aug 1st, 2015, 07:24 PM
#5
Re: Windows 7 compatibility mode
You need to tell us what you mean by "compatibility mode."
Yes, I get it that you are probably doing this via the Explorer Properties dialog's Compatibility tab, but there are many possible settings there. Which ones are you using?
-
Aug 2nd, 2015, 02:05 AM
#6
Thread Starter
Frenzied Member
Re: Windows 7 compatibility mode
I check all on M2000.exe. before the use of peekmessage I found the best a Windows 7 compatibility mode....on windows 7. Because I know what my program do, and I watch everything when this run I found that the auto refresh form was not auto refresh as in compatibility mode. So when we open the start menu...then the change of focus engage the non responding issue, as I describe earlier.
I think it will better to make a simple example to demonstrate the issue. But the idea is simple. A large loop...with a refresh on a picturebox but no doevents, demonstrate the non auto refresh of parent form and in windows 7 this get an ugly...fade to white and a dialog to close or wait. After that I start to believe that programers of windows code do something wrong..and Xp Windows are the best...
-
Aug 2nd, 2015, 04:11 AM
#7
Re: Windows 7 compatibility mode
So "Windows 7 compatibility" and which others? All? Really?
Things like 256 color mode might have an impact on performance. Hard to believe you are checking "Run in 640x480 resolution" though.
-
Aug 2nd, 2015, 06:34 AM
#8
Thread Starter
Frenzied Member
Re: Windows 7 compatibility mode
No I don't make combinations. I do a selection from Xp and up to Windows 7.
-
Aug 3rd, 2015, 09:57 AM
#9
Addicted Member
Re: Windows 7 compatibility mode
Sorry, but I don't really see the point in this topic... If your program run without setting it in a compatibility mode, then you simply don't needed it. As I understand it, these modes are there in case your program don't run as normal. In fact, I have experienced users of my program reporting it not to run and there reason have been that they (or probably some expert helping them) have applied any of the compatibility modes on it. After removing it the program runs fine.
I think it's nothing but logical, if you apply a compatibility mode on an executable it will degrade its performance, especially if not needed. How much is really not relevant - unless you do this just out of curiosity, but then it's a quation of if this is the proper forum for it.
Last edited by 7edm; Aug 3rd, 2015 at 09:59 AM.
Reason: grammar
M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?
-
Aug 3rd, 2015, 11:37 AM
#10
Thread Starter
Frenzied Member
Re: Windows 7 compatibility mode
This thread was moved here...There is a problem with windows 7 and vb6...I didn't. Perform a loop in a form but I use a form. When the loop is running form can't process messages. When this done Windows 7 open a dialog to ask for closing....or wait. I do a complex try with threads in my code as a game, so we have an object to move, and do experiments, one of them use peekmessage and process them. Today I found one ore two times the hang dialog. But this loop in the game are not end, except you press 1, so windows when raise dialog we can't gain get focus on form. You see the problem now is rare but exist. I am in revision 24....and I am waiting to publish the code until found exactly what is fault. I use a linux system with two virtual boxes, one with Xp for the vb ide and one for Windows 7... for checking. Linux is a rock, but windows have nice os, or known os....to be honest...
-
Aug 3rd, 2015, 11:45 AM
#11
Addicted Member
Re: Windows 7 compatibility mode
Ok then I understand better, it wasn't clear to me from your initial post that you actually had a problem running in "normal" mode. Fine then, but unfortunately I have no solution to offer at this point.
M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?
-
Aug 3rd, 2015, 12:44 PM
#12
Re: Windows 7 compatibility mode
I told you what you have to do.
Install the Application Compatibility Toolkit, which will allow you to look up the appcompat shims that are bundled within the Compatibility Mode you are using.
Then you will have to investigate what each of the shims does (which varies from easy to track down to hard) and determine which one might be causing your problem. If I had to guess I'd say it is probably one of the display management related shims.
Figuring that out might let you make program changes that won't have a performance problem with that shim applied... or it might not.
But none of what you have said tells us why you are using any appcompat for this program at all.
-
Aug 3rd, 2015, 01:48 PM
#13
Thread Starter
Frenzied Member
Re: Windows 7 compatibility mode
This is my test program. Two programs in one as you can see, watching the video.
I found my problem. I use peekmessage with upper filter &h8000 (supposed that is the max, but maybe not). I wrote the fast Bitmap rotation and merging to picturebox with transparency in a color and to all pixels and resizing in one function. So in example every sprite paint done after rotation and merging. I use a simple save of background, command HOLD, and i put it every time, command RELEASE, and then the sprites...and the final point I do a refresh.
I found before a week an interesting alternative DoEvents, from Nir Sofer, but this works to empty the message queque in one call. I think to do that in parts, excluding the refreshing of pictureboxes, because I want to handle when the refresh happen (so graphics are changed good).
line "MyDoEvents2 bstack.Owner" call an older own version (but still in use) of a MyDoEvents to handle the rerfesh counter. Bstack is the process object (an object of M2000 own) and owner is the attach control, a picturebox (from layers) or the main form.
Code:
Public Sub MyDoEvents1(bstack As basetask)
Dim CurrMsg As Msg
'The following loop extract all messages from the queue and dispatch them
'to the appropriate window.
'' Do While PeekMessage(CurrMsg, 0, 0, 0, PM_REMOVE) <> 0
Select Case st
Case 0
If PeekMessage(CurrMsg, 0, 0, 14, PM_REMOVE) <> 0 Then
TranslateMessage CurrMsg
DispatchMessage CurrMsg
End If
st = 1
Case 1 '' 255 - 271
If PeekMessage(CurrMsg, 0, 16, 254, PM_REMOVE) <> 0 Then
TranslateMessage CurrMsg
DispatchMessage CurrMsg
End If
st = 2
Case 2
If PeekMessage(CurrMsg, 0, 272, 0, PM_REMOVE) <> 0 Then
TranslateMessage CurrMsg
DispatchMessage CurrMsg
End If
st = 3
Case 3
If PeekMessage(CurrMsg, bstack.Owner.hwnd, 15, 15, PM_REMOVE) <> 0 Then
MyDoEvents2 bstack.Owner
ElseIf PeekMessage(CurrMsg, 0, 15, 15, PM_REMOVE) <> 0 Then
TranslateMessage CurrMsg
DispatchMessage CurrMsg
End If
st = 0
End Select
End Sub
Code:
\\set fast !
pen #fff9aa
escape off
\\thread.plan sequential \\concurrent
thread.plan concurrent
hide
REFRESH 500
CLS 1,0 ' COLOR BLUE AND RESET SPLIT SCREEN SETTING TO TOP LINE
move 1500,1000
polygon 13, 1000,-500,300,1000, -2000, -500,0, -1000
PRINT "This is first line" ' WE CANT SEE THE FOUR PRINTS
PRINT "This is second line" 'BECAUSE WE SET A HIGH REFRESH RATE
PRINT "This is third line"
PRINT "This is forth line"
PRINT $(1) \\ not allowed a PRINT of an item to exceed a column (1,2,3,5,6,7,8,9)
MOVE 0,0
A$=""
COPY 3000,2000 TO A$
GRADIENT 1, 9 ' CLEAR SCREEN WITH GRADIENT
pen 14 {
for i=1 to 100 {
move random(scale.x),random(scale.y)
circle fill 14, random(3)*twipsX
}
}
PRINT part $(0),@(0,0),"SPACE BAR TO FIRE OR KEY 1 TO QUIT"
\\COPY 6000,6000 TOP A$, 10, 200
\\COPY 6000,6000 TOP A$, 45
\\COPY 2000,2000 USE A$, 45
HOLD ' save screen
MOVE 6000,6000
I=1
LET X=MOUSE.X, Y=MOUSE.Y
LET range=6000, angle=0
LET canfire= true, fireX=0, fireY=0, firesize=0
Let sX=scale.x/2, sY=scale.y/2
THREAD {
IF abs(fireX-sx)>500 THEN {
fireX=(fireX*4+SX)/5
fireY=(fireY*4+SY)/5
} ELSE {
THREAD L HOLD
canfire=true
}
} AS L
e1x=6000 : e1y=6000 : e1z=20
enemy1=true
Thread {
e1z+=5
if e1z>180 or not enemy1 then enemy1=false : thread this hold
} as E1 interval 30
Thread {
e2z+=5
if e2z>180 or not enemy2 then enemy2=false : thread this hold
} as E2
e2x=scale.x*.8 : e2y=6000 : e2z=20
enemy2=false : thread e2 hold : thread E2 interval 30
Thread {
e3z-=10
if e3z<30 or not enemy3 then enemy3=false : thread this hold
} as E3
e3x=scale.x*.8 : e3y=scale.y: e3z=180
enemy3=false : thread e3 hold : thread E3 interval 50
enemy4=false
pp=.02
X=MOUSE.X
Y=MOUSE.Y
gosub basicpart
\\move x,y
\\gosub ship
show
task.main 20 {
I++
IF keypress(49) THEN EXIT
' YOU CAN MAKE THE SECOND ROTATED OBJECT TO HAVE FLICKERING
' IF YOU DO THAT:
' COMMENT THE LINE BELOW AND PUT REFRESH TO 10 IN THE FIRST LINE
REFRESH 0 ' RESET THE REFRESH COUNTER
RELEASE
PRINT part @(0,1),STR$(NOW,"HH:MM:SS"), e1z \\, $(0),format$("({0},{1})", sX, sY)
IF MOUSE=1 THEN {
X=MOUSE.X
Y=MOUSE.Y
}
gosub basicpart
if enemy1 then {
MOVE e1x, e1y
step sx*e1z/100-scale.x/2, sy*e1z/100-scale.y/2
SPRITE A$, 1, angle/10, e1z,30+e1z/4
}
if enemy2 then {
MOVE e2x, e2y
step sx*e2z/50-scale.x/2, sy*e2z/50-scale.y/2
SPRITE A$, 1, angle/10, e2z,30+e2z/4
}
if enemy3 then {
MOVE e3x, e3y
step -( sx*e2z/100-scale.x/2), -(sy*e2z/50-scale.y/2)
SPRITE A$, 1, angle/10, e3z,30+e3z/4
}
if enemy4 then { \\not implement it yet
MOVE 8000,4000
step sx-scale.x/2, sy-scale.y/2
SPRITE A$, -1, I, 100,30
}
IF canfire AND keypress(32) THEN {
score 2, 100,"c"
canfire~ : fireX=x : fireY=y
firesize= (sqrt((scale.x/2)**2+(scale.y/2)**2)-sqrt((x-scale.x/2)**2+(y-scale.y/2)**2))/10
thread L restart
thread L interval 10
play 2, 10
} else.if not canfire then {
MOVE fireX, fireY
try { pen 4{circle fill 4, firesize}}
}
MOVE X, Y
gosub ship
if not enemy1 and random(100)>95 then gosub enshow1
if not enemy2 and random(100)>95 then gosub enshow2
if not enemy3 and random(100)>97 then gosub enshow3
REFRESH ' DO NOW A SCREEN REFRESH ONLY
}
exit
enshow1:
e1x=6000+random(2000) : e1y=6000+random(2000) : e1z=20
enemy1=true : thread E1 restart
return
enshow2:
e2x=scale.x*.8-random(2000) : e2y=6000-random(2000) : e2z=20
enemy2=true : thread E2 restart
return
enshow3:
e3x=scale.x*.8 +random(2000): e3y=scale.y: e3z=180
enemy3=true : thread E3 restart
return
basicpart:
range = sqrt((x-scale.x/2)**2+(y-scale.y/2)**2)
angle =(360*(scale.y-y)/scale.y/2)*(scale.x/2-x)/scale.x
sx=scale.x/2-(x-scale.x/2)/4
sy=scale.y/2-(y-scale.y/2)/4
move sx, sy
circle 300
move 0,scale.y-range/2
pen 2 { polygon 2, 0,0,scale.x, 0,0, range/2,-scale.x,0,0,-range/2 }
step scale.x/2,0
pen 0 {
draw to scale.x/2+(x-scale.x/2)/4, scale.y
if 1.1-PP<1 then {
move 0, scale.y-range/2*(1.1-PP)
draw scale.x,0
}
move 0, scale.y-range/1.9*(.9-PP)
draw scale.x,0
move 0, scale.y-range/1.8*(.7-PP)
draw scale.x,0
if not 1.1-PP<1 then { move 0, scale.y-range/1.75*(.5-PP)
draw scale.x,0
}
pp+=.04
if pp>.20 then pp=.02
}
return
ship:
try {
circle 300 *(12000-range)/5000
SPRITE A$, 1, angle, (12000-range)/50, 100-range/200
}
return
-
Aug 4th, 2015, 01:45 PM
#14
Thread Starter
Frenzied Member
Re: [RESOLVED] Windows 7 compatibility mode
A better version of "the game".
I found that some errors stop execution immediatly (especially if it is from a zero on a non zero parameter). I also get some non-responsing dialog form but maybe these was from example faults..not from interpreter.
Look the Set Fast !
is a switch to be the interpreter more fast (no escape key watched)
the normal is Set Fast
The other is Set Slow
It is terrible slow..with many doevents...
Code:
set fast !
pen #fff9aa
escape off
thread.plan sequential \\concurrent
\\thread.plan concurrent
hide
REFRESH 1000
CLS 1,0 ' COLOR BLUE AND RESET SPLIT SCREEN SETTING TO TOP LINE
move 1500,1000
polygon 13, 1000,-500,300,1000, -2000, -500,0, -1000
PRINT "This is first line" ' WE CANT SEE THE FOUR PRINTS
PRINT "This is second line" 'BECAUSE WE SET A HIGH REFRESH RATE
PRINT "This is third line"
PRINT "This is forth line"
PRINT $(1) \\ not allowed a PRINT of an item to exceed a column (1,2,3,5,6,7,8,9)
MOVE 0,0
A$=""
COPY 3000,2000 TO A$
GRADIENT 1, 9 ' CLEAR SCREEN WITH GRADIENT
\\image "D:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg", scale.x
pen 14 {
for i=1 to 100 {
move random(scale.x),random(scale.y)
circle fill 14, random(3)*twipsX
}
}
PRINT part $(0),@(0,0),"SPACE BAR TO FIRE OR KEY 1 TO QUIT"
\\COPY 6000,6000 TOP A$, 10, 200
\\COPY 6000,6000 TOP A$, 45
\\COPY 2000,2000 USE A$, 45
HOLD ' save screen
MOVE 6000,6000
I=1
LET X=MOUSE.X, Y=MOUSE.Y
LET range=6000, angle=0
LET canfire= true, fireX=0, fireY=0, firesize=0
Let sX=scale.x/2, sY=scale.y/2
THREAD {
IF abs(fireX-sx)>500 THEN {
fireX=(fireX*4+SX)/5
fireY=(fireY*4+SY)/5
} ELSE {
THREAD L HOLD
canfire=true
}
} AS L
e1x=6000 : e1y=6000 : e1z=20
enemy1=true
Thread {
e1z+=5
if e1z>180 or not enemy1 then enemy1=false : thread this hold
} as E1 interval 30
Thread {
e2z+=5
if e2z>180 or not enemy2 then enemy2=false : thread this hold
} as E2
e2x=scale.x*.8 : e2y=6000 : e2z=20
enemy2=false : thread e2 hold : thread E2 interval 30
Thread {
e3z-=10
if e3z<30 or not enemy3 then enemy3=false : thread this hold
} as E3
e3x=scale.x*.8 : e3y=scale.y: e3z=180
enemy3=false : thread e3 hold : thread E3 interval 50
enemy4=false
pp=.02
X=MOUSE.X
Y=MOUSE.Y
gosub basicpart
\\move x,y
\\gosub ship
show
task.main 10 {
I++
IF keypress(49) THEN EXIT
' YOU CAN MAKE THE SECOND ROTATED OBJECT TO HAVE FLICKERING
' IF YOU DO THAT:
' COMMENT THE LINE BELOW AND PUT REFRESH TO 10 IN THE FIRST LINE
REFRESH 0 ' RESET THE REFRESH COUNTER
RELEASE
PRINT part @(0,1),STR$(NOW,"HH:MM:SS"), e1z \\, $(0),format$("({0},{1})", sX, sY)
IF MOUSE=1 THEN {
X=MOUSE.X
Y=MOUSE.Y
}
gosub basicpart
if enemy1 then {
MOVE e1x, e1y
step sx*e1z/100-scale.x/2, sy*e1z/100-scale.y/2
SPRITE A$, 1, angle/10, e1z,30+e1z/4
}
if enemy2 then {
MOVE e2x, e2y
step sx*e2z/50-scale.x/2, sy*e2z/50-scale.y/2
SPRITE A$, 1, angle/10, e2z,30+e2z/4
}
if enemy3 then {
MOVE e3x, e3y
step -( sx*e2z/100-scale.x/2), -(sy*e2z/50-scale.y/2)
SPRITE A$, 1, angle/10, e3z,30+e3z/4
}
if enemy4 then { \\not implement it yet
MOVE 8000,4000
step sx-scale.x/2, sy-scale.y/2
SPRITE A$, -1, I, 100,30
}
IF canfire AND keypress(32) THEN {
score 2, 100,"g"
fireX=x : fireY=y
firesize= (sqrt((scale.x/2)**2+(scale.y/2)**2)-sqrt((x-scale.x/2)**2+(y-scale.y/2)**2))/10
if firesize<60 then firesize=60
thread L restart
thread L interval 10
play 2, 127
canfire=false
} else.if not canfire then {
MOVE fireX, fireY
try { pen 4{circle fill 4, firesize}}
}
MOVE X, Y
gosub ship
if not enemy1 and random(100)>95 then gosub enshow1
if not enemy2 and random(100)>95 then gosub enshow2
if not enemy3 and random(100)>97 then gosub enshow3
REFRESH ' DO NOW A SCREEN REFRESH ONLY
}
set fast
exit
enshow1:
e1x=6000+random(2000) : e1y=6000+random(2000) : e1z=20
enemy1=true : thread E1 restart
return
enshow2:
e2x=scale.x*.8-random(2000) : e2y=6000-random(2000) : e2z=20
enemy2=true : thread E2 restart
return
enshow3:
e3x=scale.x*.8 +random(2000): e3y=scale.y: e3z=180
enemy3=true : thread E3 restart
return
basicpart:
range = sqrt((x-scale.x/2)**2+(y-scale.y/2)**2)
angle =(360*(scale.y-y)/scale.y/2)*(scale.x/2-x)/scale.x
sx=scale.x/2-(x-scale.x/2)/4
sy=scale.y/2-(y-scale.y/2)/4
move sx, sy
circle 300
move 0,scale.y-range/2
pen 2 { polygon 2, 0,0,scale.x, 0,0, range/2,-scale.x,0,0,-range/2 }
step scale.x/2,0
pen 0 {
draw to scale.x/2+(x-scale.x/2)/4, scale.y
if 1.1-PP<1 then {
move 0, scale.y-range/2*(1.1-PP)
draw scale.x,0
}
move 0, scale.y-range/1.9*(.9-PP)
draw scale.x,0
move 0, scale.y-range/1.8*(.7-PP)
draw scale.x,0
if not 1.1-PP<1 then { move 0, scale.y-range/1.75*(.5-PP)
draw scale.x,0
}
pp+=.04
if pp>.20 then pp=.02
}
return
ship:
try {
circle abs(300 *(scale.x-range)/5000)
if (scale.x-range)/100>2 and (100-range/200)/2 then {
SPRITE A$, 1, angle, (scale.x-range)/100, 100-range/200
} else {
SPRITE A$, 1,angle, 2, 2
}
}
return
-
Aug 5th, 2015, 03:03 AM
#15
Thread Starter
Frenzied Member
Re: [RESOLVED] Windows 7 compatibility mode
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
|