a97 VS AXP .... Me.Repaint

namliam

The Mailman - AWF VIP
Local time
Today, 17:03
Joined
Aug 11, 2003
Messages
11,695
I have some apps made in A97, now the time has come to convert them to AXP.

No real conversion problems, except... My screen doesnt update anymore, i have a counter running on the screen doing something like so:

Code:
do while...
    ....
    myCounter = myCounter + 1
    me.txtDone = myCounter
    if myCounter mod 5 = 0 then me.repaint
loop

In 97 this results in my form beeing updated every 5 records, but in AXP it stops updating if the application is not "on screen". But if i minimize the app that is "on screen" lets say word... Then it doesnt start updating either....

Has anyone ever seen anything like this?

Greets

The Mailman
 
I'm not sure, but, I think that just because you can see an app, that does not me it has focus. When you min the other app, you may have to actively select the db app to start the code going again... (Just a guess)
 
The strange thing is, the code is running just fine...

It just the screen that is not showing progress. If i wait long enough for the process to finish, the app continues on its marry way....

Regards
 
Sample

I created an A2K db with only one form, which opens on startup.

If i click the button everyting works fine....
Except when i drag the explorer over the db, then it freezes after some time (not updating the screen => See included pic Counter.jpg)
If i then break the code, (See included pic CounterBreak.jpg) the counter has continued .... The code "Keeps on running" but the screen doesnt get updated.

Can anyone try this at thier WinXP/OfficeXP setup and see if this is specific to my local or to XP in general.

I can live without the counter, but its nice ... Some processes take a long time...

Greetz & TIA
 

Attachments

  • CounterBreak.zip
    CounterBreak.zip
    91.1 KB · Views: 117
  • Counter.JPG
    Counter.JPG
    16.2 KB · Views: 139
  • Counter.zip
    Counter.zip
    11.1 KB · Views: 134
Can anybody please test this small app? And see if they get the same problem?

I would like to know if i am the only one experiencing problems like this?!

Greetz
 
I added a DoEvents to your code and that seemed to resolve the problem.
Code:
Private Sub Command0_Click()
    
    Me.txtToDo = 500
    Me.txtDone = 0
    Do While Me.txtToDo > Me.txtDone
        Sleep 500
        Me.txtDone = Me.txtDone + 1
        Me.Repaint
        DoEvents
    Loop
End Sub

Do look this up in help for an explaination of what is happening and why you may or may not want to do this. It does seem to slow the app slightly.
 
DoEvents?!

That is to do stuff in windows isnt it? Seems strange you would need that... But hey M$, who may tell. I will try it in my app....

Thanks pat :)
 
Pat (and all other interested people)

I added DoEvents and it does seem to resolve the problem. COOL :cool:

This seems strange to me, but heck... it works. I also tested it and it runs a little bit slower, 0.5 secs on 25 secs processing....

Thanks again Pat.

Greetz and Saluts
 

Users who are viewing this thread

Back
Top Bottom