April 18, 2024, 12:13:11 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


The Window is not closed

Started by zolikom, October 06, 2008, 12:46:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zolikom

I am working program: Download with progress bar. I wiill automatization: IF variable zol_downMode=1 then file download automatic, and after download i will the window closed: The window not closed: must the mouse over the window: then the window is closed: This is not automatic. Why?  ::)

Regards: Nagy ZoltÃÆ'Ã,¡n

zolikom@freemail.hu

Ionic Wind Support Team

Because your message handler is only called when Windows has a message available in its queue.  Such as a mousemove message.

Use a timer to check that variable at certain intervals.

Also your code isn't thread safe.  Since you are sharing global variables between the main thread and the downloadthread.  You need to use a mutex to control access to shared resources.

Instead of a timer you could also use WaitForSingleObject on the thread handle, with a timeout of say 100ms, and process messages after each interval while it is waiting for the thread to end, that way you don't need a variable.

Paul.

Ionic Wind Support Team

zolikom

Calling the subroutine:

SUB zol_DownWin(WebAddressTheFile,LocalPathTheFile,window closed or no)
IF 'window closed or no'=0 Then download start, and finishing closed window on controls in window.

IF 'window closed or no'=1 then download starting automatic, and finished i will closed window.
The download function O.K., a not closed the window.

In finishing download in line 73. :IF zol_DMode=1 THEN zol_DMode=2
and in windowhandle subroutine: in line 46.: IF zol_DMode=2 THEN CLOSEWINDOW DownWin

The window not closed.

ZoltÃÆ'Ã,¡n  :o

Ionic Wind Support Team

Yes I read it, and I told you why and what you needed to do.

You have a statement that is not in response to a message.  Use a timer or WaitForSingleObject. 

This is Windows, and in Windows your message handler subroutine is only called when there is a message available in the queue.  Your IF statement does nothing unless a message, any message, is being processed.  Which is why you see it close when you move your mouse.

Anyone here speak his langauge?

Paul.
Ionic Wind Support Team

zolikom

Yes, technikal english is heavy.

I think the timer to check that variable is good idea.

I testing it

Thank You for instriktions.

Regards: ZoltÃÆ'Ã,¡n   :)

aurelCB

And I allways mean that mine is bad(uf this or that gramatic)!

zolikom

Of course you would have been thinking for a long time if I would have asked in Hungarian

That Window is working:

Thanks for all. Regards: ZoltÃÆ'Ã,¡n  ;D

Techno

Quote from: zolikom on October 06, 2008, 07:12:07 AM
Of course you would have been thinking for a long time if I would have asked in Hungarian

That Window is working:

Thanks for all. Regards: ZoltÃÆ'Ã,¡n  ;D

Hi All,

This sources can not compile with the IWBasic v2.0 and v3.0 Professional. What is er changed here?

This is the error report



Compiling Resources...
No Errors

Compiling...
download_with_progressbar_v1.1.iwb
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (24) Warning: Argument 9 (winsub_DownWin) does not match the declaration of IWBWNDPROC
Different return type: none, should be int
File: C:\IWBDev3\bin\iwbstd.incc (10) Warning: See previous declaration of IWBWNDPROC
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (39) Warning: See previous declaration of winsub_DownWin
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (31) Error: Undefined function ProgressBar
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (69) Error: Undefined function pbSetPosition
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (74) Warning: constant/variable name collision: NULL
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (83) Error: Undefined function pbSetRange
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (83) Error: Undefined function pbSetPosition
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (83) Error: Undefined function pbSetStep
Error(s) in compiling "c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb"
Build Failed


LarryMc

The error report is telling you what is wrong:
QuoteFile: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (31) Error: Undefined function ProgressBar
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (69) Error: Undefined function pbSetPosition
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (83) Error: Undefined function pbSetRange
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (83) Error: Undefined function pbSetPosition
File: c:\users\public\documents\development\iwbasic\projects\roundtable\dl w progressbar\download_with_progressbar_v1.1.iwb (83) Error: Undefined function pbSetStep
Since there is no include file in the code that leads me to believe that the original author was using the old controlpak addon for EBasic with its incc file. and thos subroutines were defined in that lib. (it tells you that in the comment in line 11 of the source code)
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library