Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IndexBar:Advance yelds "Window is not responding"

85 views
Skip to first unread message

Grzegorz R.

unread,
Sep 6, 2022, 5:56:03 AM9/6/22
to
Hi Friends
MS has changed something in system because what in XP and earlier W10 worked fine - now does not work.
I have a progress window with progress bar(s) that should advance according to process run (like searching for the data).
It always worked fin but since spring this year it doe NOT work any more ie very often (nearly always) i get message "window not respoding" and progressbar stops although process runs and finishes.
I tried to use quasitimer (save and compare seconds()) to "advance" only once per second (even if more "ticks"/advances happened) but it didn't help.
How can I keep my progressbar working without freezing the window?
I can show my code but there is nothing much.

Any help highly aprreciated

Gregory

Jamal

unread,
Sep 6, 2022, 2:02:04 PM9/6/22
to
Hi Gregory!

As a programmer (you and others), to get help from fellow programmers, I
suggest that you always provide more information. Do not assume we know
your exact development/runtime environment.

1. Complete VO Version.
2. Windows Version.
3. Post reproducible code.

Jamal

Grzegorz R.

unread,
Sep 7, 2022, 2:49:47 AM9/7/22
to
Hello Jamal
I'm sorry...
VO2.8SP4b + Win10 21H2 19044.1889

Code is simple:
OknoPostepu (ProgressWin) inherited from DialogWindow created from toolbar
that has
IndexBar as ProgressBar

code from VO

RESOURCE OknoPostepu DIALOGEX 5, 19, 260, 45
STYLE DS_3DLOOK|WS_POPUP|WS_CAPTION|WS_SYSMENU
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "Indeksowanie", OKNOPOSTEPU_INDEXBAR, "msctls_progress32", WS_CHILD, 8, 7, 244, 11
END

CLASS OknoPostepu INHERIT DIALOGWINDOW
PROTECT oDCIndexBar AS PROGRESSBAR
//{{%UC%}} USER CODE STARTS HERE (do NOT remove this line)

METHOD Advance() CLASS OknoPostepu
SELF:oDCIndexBar:Advance(1)
RETURN NIL

METHOD EndWin() CLASS OknoPostepu
SELF:EndDialog()
RETURN NIL

METHOD Init(oParent,uExtra) CLASS OknoPostepu
SELF:PreInit(oParent,uExtra)
SUPER:Init(oParent,ResourceID{"OknoPostepu",_GetInst()},FALSE)
oDCIndexBar := ProgressBar{SELF,ResourceID{OKNOPOSTEPU_INDEXBAR,_GetInst()}}
oDCIndexBar:HyperLabel := HyperLabel{#IndexBar,"Indeksowanie",NULL_STRING,NULL_STRING}
oDCIndexBar:Range := Range{0,23}
SELF:Caption := ""
SELF:HyperLabel :=HyperLabel{#OknoPostepu,NULL_STRING,NULL_STRING,NULL_STRING}
SELF:PostInit(oParent,uExtra)
RETURN SELF

STATIC DEFINE OKNOPOSTEPU_INDEXBAR := 100


and in main program loop

FOR Rec := 1 to 10
//do something
OknoPostepu:Advance()
NEXT

Just like that - nothing very special.
Regards
Gregory

Massimo Bighelli

unread,
Sep 7, 2022, 10:55:17 AM9/7/22
to
try add ProcessEvent after your Advance
(I do not recall the exact sintax because I do not use VO since 2012)

Massimo
*Massimo Bighelli* ARCA Sistemi S.r.l.

Jamal

unread,
Sep 7, 2022, 11:01:20 AM9/7/22
to
Add ApplicationExec( EXECWHILEEVENT ) in your loop.

There is a problem with VO 2.8 and progressbar Range with large values.
Might as well add the following to your app:

ASSIGN Range32( oRange32 ) CLASS ProgressBar
LOCAL liMin as dword
LOCAL liMax AS LONG
liMin := oRange32:Min
liMax := long(oRange32:Max)
SendMessage(SELF:Handle(), PBM_SETRANGE32,liMin,liMax )
RETURN SELF:oRange := oRange32



ACCESS Range32() CLASS ProgressBar
RETURN oRange


Then set oDCIndexBar:Range32 := Range{0,23} in the PostInit(..) method
or Button click method.




Jamal
0 new messages