Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-30 Thread Ivanko B
Oops, me found the one to blame - WWW-browser in the 99% cases used
mode quick reply where this quiting can't be avoided easily.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-29 Thread Ivanko B
(But as an aside: would it be too much to ask to remove the trainload of
 old posting remnants from the tail of your message?)
==
Hmm..It's the feature of mail/NNTP client.
Me'll check for it.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-28 Thread Martin Schreiber
On Saturday 28 July 2012 00:35:36 Ivanko B wrote:
 Therefore the suggestion to use a timer to close the application.
 ===
 Please spell the exact sequence of calls (incl tuning  starting the
 timer, redrawing widgets etc) - in the thread world even well known
 components appear stranger - me spent a couple of hour just to make
 use of TTimer but failed :)

In worker thread:

 theoneshottimer.active:= true;

In theoneshottimer.ontimer:

 application.terminated:= true;


Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-28 Thread Ivanko B
In worker thread:
 
  theoneshottimer.active:= true;



Or all in the main thread:

//---
thread.active:= true;
thread.waitfor;
[..lblStatus etc ..]
timer.active:= true; // calls timer.Ontimer { application.terminated:= true; }
//

?


2012/7/28, Martin Schreiber mse00...@gmail.com:
 On Saturday 28 July 2012 00:35:36 Ivanko B wrote:
 Therefore the suggestion to use a timer to close the application.
 ===
 Please spell the exact sequence of calls (incl tuning  starting the
 timer, redrawing widgets etc) - in the thread world even well known
 components appear stranger - me spent a couple of hour just to make
 use of TTimer but failed :)

 In worker thread:
 
  theoneshottimer.active:= true;
 
 In theoneshottimer.ontimer:
 
  application.terminated:= true;
 

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-28 Thread Martin Schreiber
On Saturday 28 July 2012 10:26:03 Ivanko B wrote:
 In worker thread:
  
   theoneshottimer.active:= true;
 
 

 Or all in the main thread:

 //---
 thread.active:= true;
 thread.waitfor;
 --- now GUI interaction (display update, possible cancel button...) stops.
Intended?

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-28 Thread Martin Schreiber
On Saturday 28 July 2012 11:33:11 Ivanko B wrote:
 How then to implement same scenario for multiple working threads where
 such threads can't place calls to terminate the application ?

Send messages to the controlling form or datamodule:

thecontrollingmodule.asyncevent(integer_which_identifies_the_sending_thread);

In thecontrollingmodule.onasyncevent check if all threads are terminated, if 
yes set start the display wait timer.

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-28 Thread Ivanko B
check if all threads are terminated,
=
How to know that if tread already exited  Is there a specific API for
not to keep [un]locked global flag (thread state) variables (or arrays
of such variables) ?



2012/7/28, Martin Schreiber mse00...@gmail.com:
 On Saturday 28 July 2012 11:33:11 Ivanko B wrote:
 How then to implement same scenario for multiple working threads where
 such threads can't place calls to terminate the application ?

 Send messages to the controlling form or datamodule:
 
 thecontrollingmodule.asyncevent(integer_which_identifies_the_sending_thread);
 
 In thecontrollingmodule.onasyncevent check if all threads are terminated,
 if
 yes set start the display wait timer.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-28 Thread Ivanko B
According to your other postings, that's understandable - you used quite
 inept means for your goal - like a sleep call that suspends your
 application as a whole, or a waitfor call that suspends the main thread.
 You ought to be careful to _not_ do that, but keep your application's
 threads running.
===
Because me still cant understand what's doing exactly :)


You really should try the approach Martin suggested: set up a timer that
 will terminate your application, start it when your worker thread ends, and
 have your worker thread signal your main thread about the results. Your
 main thread should run unhindered all the time, so it can display whatever
 is needed on behalf of the worker thread, and the timer, executing in
 parallel as well (also a kind of multi-threading, albeit cooperative multi-
 threading in this case) will terminate your application in a timely manner
 after all the turmoil has settled. ;-)
=
Than to everybody for the advices ! Will be tried on  the Monday (at
the moment me couldn't get a free WWW-site with working FTP uploading
 creating directories, to test the things at home)

2012/7/29, Sieghard s_c_...@arcor.de:
 Hallo Ivanko,

 Du schriebst am Sat, 28 Jul 2012 03:26:12 +0500:

 Well, really there's a single worker thread in the application but me
 wanted to achieve an universal solution.

 A single secondary thread is enough to make your application
 multi-threaded.

 Why don't you set a flag, send a message or use another means to signal
 ...
 Surely me tried it first but with this approach me couldn't get proper
 drawing informational widgets then showing them for a while the auto

 According to your other postings, that's understandable - you used quite
 inept means for your goal - like a sleep call that suspends your
 application as a whole, or a waitfor call that suspends the main thread.
 You ought to be careful to _not_ do that, but keep your application's
 threads running.

 exiting the application. And none of OnDestory, OnTerminateQuery,
 OnTerminate can't be used to hook on for that since OnDestory 

 Well - I'd guess those simply don't work because they're called to late in
 application processing, at a time when the application is already about to
 cease working and simply _cannot_ perform the task you request any more.

 You really should try the approach Martin suggested: set up a timer that
 will terminate your application, start it when your worker thread ends, and
 have your worker thread signal your main thread about the results. Your
 main thread should run unhindered all the time, so it can display whatever
 is needed on behalf of the worker thread, and the timer, executing in
 parallel as well (also a kind of multi-threading, albeit cooperative multi-
 threading in this case) will terminate your application in a timely manner
 after all the turmoil has settled. ;-)

 --
 (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
 nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
 ---
 Mit freundlichen Grüßen, S. Schicktanz
 ---


 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-27 Thread Ivanko B
Ttimer's options are't settable via ObjInsp but the leak one.

2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Self exiting the program or the thread?
 ==
 The program.


 2012/7/26, Martin Schreiber mse00...@gmail.com:
 Am 25.07.2012 05:24, schrieb Martin Schreiber:
 On Tuesday 24 July 2012 21:11:25 Ivanko B wrote:
   to move gui code in  main thread.
 =
 Any or particular type of GUI code ?

 On Windows any. Use application.lock/unlock in order to set common
 variables
 only, unless we can solve all Windows multithread API problems (no time
 at
 the moment).

 git master 1bcf30af9eae1cca061e315d5bc37d2cfadc8226 uses
 application.synchronize() for showmessage(). The windows deadlocks are
 too difficult to be solved.

 Martin


 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-27 Thread Martin Schreiber
On Friday 27 July 2012 12:23:06 Ivanko B wrote:
 Ttimer's options are't settable via ObjInsp but the leak one.


 timeroptionty = (to_single,   //single shot
  to_absolute, //use absolute time (timestamp()) for to_single
   //disabled for ttimer
  to_autostart,//set enabled for to_single by setting 
interval,
   //disabled for ttimer
  to_leak);//do not catch up missed timeouts


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-27 Thread Ivanko B
o_autostart,//set enabled for to_single by setting
interval,
=
It can't be set enabled.

pS:
TTimer doesn't help lblStatus  progrssbar to redraw in THreadComp.OnTerminated.


2012/7/27, Martin Schreiber mse00...@gmail.com:
 On Friday 27 July 2012 12:23:06 Ivanko B wrote:
 Ttimer's options are't settable via ObjInsp but the leak one.

 
  timeroptionty = (to_single,   //single shot
   to_absolute, //use absolute time (timestamp()) for
 to_single
//disabled for ttimer
   to_autostart,//set enabled for to_single by setting
 interval,
//disabled for ttimer
   to_leak);//do not catch up missed timeouts
 

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-27 Thread Ivanko B
The only working code in TheradComp.OnTreminated:

//--

btnCancel.enabled:= false;
case RESULTCODETY(ExitCode) of
  SUCCESS: begin
lblFinStatus.caption:= 'Завершено успешно.';
lblFinStatus.color:= cl_ltgreen;
pbCurrentFile.value:= 1;
pbTotals.value:= 1;
  end;
  CANCELLED: begin
lblFinStatus.caption:= 'Отменено.';
lblFinStatus.color:= cl_ltblue;
  end
  else {FAILED}
lblFinStatus.caption:= 'Произошла ошибка.';
lblFinStatus.color:= cl_ltred;
end;
application.processmessages();
sleepus(300);
if ExitCode = integer(FAILED) then begin
  showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');
end;
application.terminated:= true; {не вызывает app.OnterminateQuery}

//--

Don't the work of application.processmessages() should be done in
THreadcomp.OnTreminated automaticcaly ?


2012/7/27, Ivanko B ivankob4m...@gmail.com:
 o_autostart,//set enabled for to_single by setting
 interval,
 =
 It can't be set enabled.

 pS:
 TTimer doesn't help lblStatus  progrssbar to redraw in
 THreadComp.OnTerminated.


 2012/7/27, Martin Schreiber mse00...@gmail.com:
 On Friday 27 July 2012 12:23:06 Ivanko B wrote:
 Ttimer's options are't settable via ObjInsp but the leak one.

 
  timeroptionty = (to_single,   //single shot
   to_absolute, //use absolute time (timestamp()) for
 to_single
//disabled for ttimer
   to_autostart,//set enabled for to_single by setting
 interval,
//disabled for ttimer
   to_leak);//do not catch up missed timeouts
 

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-27 Thread Martin Schreiber
On Friday 27 July 2012 14:05:05 Ivanko B wrote:
 The only working code in TheradComp.OnTreminated:

 Don't the work of application.processmessages() should be done in
 THreadcomp.OnTreminated automaticcaly ?

The sleep() call is in main thread - main thread eventloop sleeps - no gui 
action. Therefore the suggestion to use a timer to close the application.

Or use tthreadcomp.onterminate instead of terminated, it runs in worker thread 
context:

 application.unlock; //application is locked in onterminate
 sleepus(300);
 application.lock;   //restore lock state
 if ExitCode = integer(FAILED) then begin
  showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ'); 
 //showmesssage is thread safe
 end;
 application.terminated:= true; {не вызывает app.OnterminateQuery}
end;

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-27 Thread Sieghard
Hallo Ivanko,

Du schriebst am Thu, 26 Jul 2012 16:52:39 +0500:

 Hmm.. me terminate the application in one of its threads.

Bad practice, I'd say.

 What is Your opinion on proper build such kind of programs (serving a
 long running thread  then self-exiting with a delay before exit) ?

Why don't you set a flag, send a message or use another means to signal the
main thread that your worker thread has terminated (perhaps simply polling
its terminated state), do the neccessary clean up and only then exit the
main program? No more worries about thread clean up or synchronization and
suxh...

-- 
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
---
Mit freundlichen Grüßen, S. Schicktanz
---


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-27 Thread Ivanko B
to use a timer to close the application.
===
In OnTimer ?


2012/7/28, Ivanko B ivankob4m...@gmail.com:
 Therefore the suggestion to use a timer to close the application.
 ===
 Please spell the exact sequence of calls (incl tuning  starting the
 timer, redrawing widgets etc) - in the thread world even well known
 components appear stranger - me spent a couple of hour just to make
 use of TTimer but failed :)

 2012/7/28, Ivanko B ivankob4m...@gmail.com:
 Possibly for such cases there's should be a special  form/application
 event handler.


 2012/7/28, Ivanko B ivankob4m...@gmail.com:
 Bad practice, I'd say.
 ===
 Well, really there's a single worker thread in the application but me
 wanted to achieve an universal solution.

 Why don't you set a flag, send a message or use another means to signal
 the
  main thread that your worker thread has terminated (perhaps simply
 polling
  its terminated state), do the neccessary clean up and only then exit
 the
  main program? No more worries about thread clean up or synchronization
 and
  suxh...
 ===
 Surely me tried it first but with this approach me couldn't get proper
 drawing informational widgets then showing them for a while the auto
 exiting the application. And none of OnDestory, OnTerminateQuery,
 OnTerminate can't be used to hook on for that since OnDestory 
 OnTerminate are too late as long as OnTerminateQuery contradicts to
 auto exiting - someone had to tell the application It's time to exit
 :)


 2012/7/26, Sieghard s_c_...@arcor.de:
 Hallo Ivanko,

 Du schriebst am Thu, 26 Jul 2012 16:52:39 +0500:

 Hmm.. me terminate the application in one of its threads.

 Bad practice, I'd say.

 What is Your opinion on proper build such kind of programs (serving a
 long running thread  then self-exiting with a delay before exit) ?

 Why don't you set a flag, send a message or use another means to signal
 the
 main thread that your worker thread has terminated (perhaps simply
 polling
 its terminated state), do the neccessary clean up and only then exit
 the
 main program? No more worries about thread clean up or synchronization
 and
 suxh...

 --
 (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
 nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
 ---
 Mit freundlichen Grüßen, S. Schicktanz
 ---


 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk





--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Ivanko B
ThreadComp.OnterminateD seems not to be called if
ThreadComp.Onterminate calls aplication.terminated:= true at its end
so moving ShowMessage to ThreadComp.OnterminateD doesn't help.


2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Hmm..The lblFinStatus.* stuff doesn't redraw in OnTerminated:

 //-
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
 [...]
 waitus(300);
 //-

 application.unlock+lock doesn't help.


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Oops, it's a new event handler. Appzs !


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 1) still needs application.lock/unlock to redraw GUI elements
 2) ShowMessage still doesn't show

 //

 procedure tmainfo.tdupadteterminate(const sender: tthreadcomp);
 begin
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
   CANCELLED: begin
 lblFinStatus.caption:= 'Отменено.';
 lblFinStatus.color:= cl_ltblue;
   end
   else {FAILED}
 lblFinStatus.caption:= 'Произошла ошибка.';
 lblFinStatus.color:= cl_ltred;
 end;
 application.unlock;
 waitus(300);
 if ExitCode = integer(FAILED) then begin
   showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');
 end;
 application.lock;
 {выйти из программы по завершении sender.OnExecute}
 application.terminated:= true; {не вызывает app.OnterminateQuery}
 end;

 2012/7/26, Martin Schreiber mse00...@gmail.com:
 On Thursday 26 July 2012 06:52:45 Ivanko B wrote:
 threadcomp.onterminated which runs in main thread by means of
 synchronize(). ==
 Should threadcomp.onstarted do it too ?
 (just a question)

 I don't think so because starting a thread normally will be done in
 main
 thread.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk





--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Martin Schreiber
On Thursday 26 July 2012 08:00:55 Ivanko B wrote:
 ThreadComp.OnterminateD seems not to be called if
 ThreadComp.Onterminate calls aplication.terminated:= true at its end
 so moving ShowMessage to ThreadComp.OnterminateD doesn't help.

After application.terminated has been set to true the application will be 
terminated. ;-)
All main loops will exit - no GUI interaction possible after 
application.terminated has been set to true.

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Ivanko B
Oops, it was becfuse of Application.terminated.
Appzs for my being so inattentive - today me had a visit to stomatist :)

2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Application.terminated:= true called in Treadcomp.OnTerminated ater
 ShowMessage seems to be a solution.
 But is it OK that the progress_bar+waitus(300)  only redraw in
 ThreadComp.OnTerminate + application.unlock/lock ? Me expected it to
 redraw in Treadcomp.OnTerminated and w/o application.unlock/lock.

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 ThreadComp.OnterminateD seems not to be called if
 ThreadComp.Onterminate calls aplication.terminated:= true at its end
 so moving ShowMessage to ThreadComp.OnterminateD doesn't help.


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Hmm..The lblFinStatus.* stuff doesn't redraw in OnTerminated:

 //-
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
 [...]
 waitus(300);
 //-

 application.unlock+lock doesn't help.


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Oops, it's a new event handler. Appzs !


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 1) still needs application.lock/unlock to redraw GUI elements
 2) ShowMessage still doesn't show

 //

 procedure tmainfo.tdupadteterminate(const sender: tthreadcomp);
 begin
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
   CANCELLED: begin
 lblFinStatus.caption:= 'Отменено.';
 lblFinStatus.color:= cl_ltblue;
   end
   else {FAILED}
 lblFinStatus.caption:= 'Произошла ошибка.';
 lblFinStatus.color:= cl_ltred;
 end;
 application.unlock;
 waitus(300);
 if ExitCode = integer(FAILED) then begin
   showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');
 end;
 application.lock;
 {выйти из программы по завершении sender.OnExecute}
 application.terminated:= true; {не вызывает app.OnterminateQuery}
 end;

 2012/7/26, Martin Schreiber mse00...@gmail.com:
 On Thursday 26 July 2012 06:52:45 Ivanko B wrote:
 threadcomp.onterminated which runs in main thread by means of
 synchronize(). ==
 Should threadcomp.onstarted do it too ?
 (just a question)

 I don't think so because starting a thread normally will be done in
 main
 thread.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk







--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Martin Schreiber
On Thursday 26 July 2012 08:11:45 Ivanko B wrote:
 Application.terminated:= true called in Treadcomp.OnTerminated ater
 ShowMessage seems to be a solution.
 But is it OK that the progress_bar+waitus(300)  only redraw in
 ThreadComp.OnTerminate + application.unlock/lock ? Me expected it to
 redraw in Treadcomp.OnTerminated and w/o application.unlock/lock.

What is the purpose of waitus(300)?

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Ivanko B
Oops, it was becfuse of Application.terminated.
=
No, the code (lblFinStatus.* in threadcomp.OnTerminated) is entered,
but the affected  widgets don't redraw after that code performed.

So, the current solution is:

 lblFinStatus.*  waitus(..) - in threadcomp.OnTerminate
 ShowMessage  application.terminated -  in threadcomp.OnTerminateD

works but feels not ideal.

2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Oops, it was becfuse of Application.terminated.
 Appzs for my being so inattentive - today me had a visit to stomatist :)

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Application.terminated:= true called in Treadcomp.OnTerminated ater
 ShowMessage seems to be a solution.
 But is it OK that the progress_bar+waitus(300)  only redraw in
 ThreadComp.OnTerminate + application.unlock/lock ? Me expected it to
 redraw in Treadcomp.OnTerminated and w/o application.unlock/lock.

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 ThreadComp.OnterminateD seems not to be called if
 ThreadComp.Onterminate calls aplication.terminated:= true at its end
 so moving ShowMessage to ThreadComp.OnterminateD doesn't help.


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Hmm..The lblFinStatus.* stuff doesn't redraw in OnTerminated:

 //-
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
 [...]
 waitus(300);
 //-

 application.unlock+lock doesn't help.


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Oops, it's a new event handler. Appzs !


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 1) still needs application.lock/unlock to redraw GUI elements
 2) ShowMessage still doesn't show

 //

 procedure tmainfo.tdupadteterminate(const sender: tthreadcomp);
 begin
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
   CANCELLED: begin
 lblFinStatus.caption:= 'Отменено.';
 lblFinStatus.color:= cl_ltblue;
   end
   else {FAILED}
 lblFinStatus.caption:= 'Произошла ошибка.';
 lblFinStatus.color:= cl_ltred;
 end;
 application.unlock;
 waitus(300);
 if ExitCode = integer(FAILED) then begin
   showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');
 end;
 application.lock;
 {выйти из программы по завершении sender.OnExecute}
 application.terminated:= true; {не вызывает app.OnterminateQuery}
 end;

 2012/7/26, Martin Schreiber mse00...@gmail.com:
 On Thursday 26 July 2012 06:52:45 Ivanko B wrote:
 threadcomp.onterminated which runs in main thread by means of
 synchronize(). ==
 Should threadcomp.onstarted do it too ?
 (just a question)

 I don't think so because starting a thread normally will be done in
 main
 thread.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk








--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Ivanko B
What is the purpose of waitus(300)?

For user to watch lblFinStatus.(caption  color).


2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Oops, it was becfuse of Application.terminated.
 =
 No, the code (lblFinStatus.* in threadcomp.OnTerminated) is entered,
 but the affected  widgets don't redraw after that code performed.

 So, the current solution is:

  lblFinStatus.*  waitus(..) - in threadcomp.OnTerminate
  ShowMessage  application.terminated -  in threadcomp.OnTerminateD

 works but feels not ideal.

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Oops, it was becfuse of Application.terminated.
 Appzs for my being so inattentive - today me had a visit to stomatist :)

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Application.terminated:= true called in Treadcomp.OnTerminated ater
 ShowMessage seems to be a solution.
 But is it OK that the progress_bar+waitus(300)  only redraw in
 ThreadComp.OnTerminate + application.unlock/lock ? Me expected it to
 redraw in Treadcomp.OnTerminated and w/o application.unlock/lock.

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 ThreadComp.OnterminateD seems not to be called if
 ThreadComp.Onterminate calls aplication.terminated:= true at its end
 so moving ShowMessage to ThreadComp.OnterminateD doesn't help.


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Hmm..The lblFinStatus.* stuff doesn't redraw in OnTerminated:

 //-
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
 [...]
 waitus(300);
 //-

 application.unlock+lock doesn't help.


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Oops, it's a new event handler. Appzs !


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 1) still needs application.lock/unlock to redraw GUI elements
 2) ShowMessage still doesn't show

 //

 procedure tmainfo.tdupadteterminate(const sender: tthreadcomp);
 begin
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
   CANCELLED: begin
 lblFinStatus.caption:= 'Отменено.';
 lblFinStatus.color:= cl_ltblue;
   end
   else {FAILED}
 lblFinStatus.caption:= 'Произошла ошибка.';
 lblFinStatus.color:= cl_ltred;
 end;
 application.unlock;
 waitus(300);
 if ExitCode = integer(FAILED) then begin
   showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');
 end;
 application.lock;
 {выйти из программы по завершении sender.OnExecute}
 application.terminated:= true; {не вызывает app.OnterminateQuery}
 end;

 2012/7/26, Martin Schreiber mse00...@gmail.com:
 On Thursday 26 July 2012 06:52:45 Ivanko B wrote:
 threadcomp.onterminated which runs in main thread by means of
 synchronize(). ==
 Should threadcomp.onstarted do it too ?
 (just a question)

 I don't think so because starting a thread normally will be done in
 main
 thread.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk









--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Ivanko B
a visit to stomatist
=
To a dentist, sure :) Approx 5$ per a tooth.


2012/7/26, Ivanko B ivankob4m...@gmail.com:
 What is the purpose of waitus(300)?
 
 For user to watch lblFinStatus.(caption  color).


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Oops, it was becfuse of Application.terminated.
 =
 No, the code (lblFinStatus.* in threadcomp.OnTerminated) is entered,
 but the affected  widgets don't redraw after that code performed.

 So, the current solution is:

  lblFinStatus.*  waitus(..) - in threadcomp.OnTerminate
  ShowMessage  application.terminated -  in threadcomp.OnTerminateD

 works but feels not ideal.

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Oops, it was becfuse of Application.terminated.
 Appzs for my being so inattentive - today me had a visit to stomatist :)

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Application.terminated:= true called in Treadcomp.OnTerminated ater
 ShowMessage seems to be a solution.
 But is it OK that the progress_bar+waitus(300)  only redraw in
 ThreadComp.OnTerminate + application.unlock/lock ? Me expected it to
 redraw in Treadcomp.OnTerminated and w/o application.unlock/lock.

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 ThreadComp.OnterminateD seems not to be called if
 ThreadComp.Onterminate calls aplication.terminated:= true at its end
 so moving ShowMessage to ThreadComp.OnterminateD doesn't help.


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Hmm..The lblFinStatus.* stuff doesn't redraw in OnTerminated:

 //-
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
 [...]
 waitus(300);
 //-

 application.unlock+lock doesn't help.


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Oops, it's a new event handler. Appzs !


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 1) still needs application.lock/unlock to redraw GUI elements
 2) ShowMessage still doesn't show

 //

 procedure tmainfo.tdupadteterminate(const sender: tthreadcomp);
 begin
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
   CANCELLED: begin
 lblFinStatus.caption:= 'Отменено.';
 lblFinStatus.color:= cl_ltblue;
   end
   else {FAILED}
 lblFinStatus.caption:= 'Произошла ошибка.';
 lblFinStatus.color:= cl_ltred;
 end;
 application.unlock;
 waitus(300);
 if ExitCode = integer(FAILED) then begin
   showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');
 end;
 application.lock;
 {выйти из программы по завершении sender.OnExecute}
 application.terminated:= true; {не вызывает app.OnterminateQuery}
 end;

 2012/7/26, Martin Schreiber mse00...@gmail.com:
 On Thursday 26 July 2012 06:52:45 Ivanko B wrote:
 threadcomp.onterminated which runs in main thread by means of
 synchronize(). ==
 Should threadcomp.onstarted do it too ?
 (just a question)

 I don't think so because starting a thread normally will be done
 in
 main
 thread.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk










--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Martin Schreiber
On Thursday 26 July 2012 08:28:29 Ivanko B wrote:
 What is the purpose of waitus(300)?
 
 For user to watch lblFinStatus.(caption  color).

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
  Oops, it was becfuse of Application.terminated.
  =
  No, the code (lblFinStatus.* in threadcomp.OnTerminated) is entered,
  but the affected  widgets don't redraw after that code performed.
 
  So, the current solution is:
 
   lblFinStatus.*  waitus(..) - in threadcomp.OnTerminate
   ShowMessage  application.terminated -  in threadcomp.OnTerminateD
 
  works but feels not ideal.
 
Looks OK for me. sleep() must run in worker thread, showmessage() in main 
thread because of Windows restriction.

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Ivanko B
Looks OK for me. sleep() must run in worker thread,
==
Why ? The purpose of this command in the project is to delay exiting
the whole program for a while after finishing all threads so that user
can see the results.

showmessage() in main
 thread because of Windows restriction.
==
But changing lblFinStatus.* etc in ThreadCiomp.OnTerminated(running
in main thread)  doesn't redraw the affected widgets, is it as
designed ? Acc to the program logic, it should display the final
statistics  results.

PS:
Me still can't get threading clearly :) A can of worms :)


2012/7/26, Martin Schreiber mse00...@gmail.com:
 On Thursday 26 July 2012 08:28:29 Ivanko B wrote:
 What is the purpose of waitus(300)?
 
 For user to watch lblFinStatus.(caption  color).

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
  Oops, it was becfuse of Application.terminated.
  =
  No, the code (lblFinStatus.* in threadcomp.OnTerminated) is entered,
  but the affected  widgets don't redraw after that code performed.
 
  So, the current solution is:
 
   lblFinStatus.*  waitus(..) - in threadcomp.OnTerminate
   ShowMessage  application.terminated -  in threadcomp.OnTerminateD
 
  works but feels not ideal.
 
 Looks OK for me. sleep() must run in worker thread, showmessage() in main
 thread because of Windows restriction.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Ivanko B
The purpose of this command in the project is to delay exiting
 the whole program for a while after finishing all threads so that user
 can see the results.
==
Hmm.. me terminate the application in one of its threads.
What is Your opinion on proper build such kind of programs (serving a
long running thread  then self-exiting with a delay before exit) ?


2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Looks OK for me. sleep() must run in worker thread,
 ==
 Why ? The purpose of this command in the project is to delay exiting
 the whole program for a while after finishing all threads so that user
 can see the results.

 showmessage() in main
  thread because of Windows restriction.
 ==
 But changing lblFinStatus.* etc in ThreadCiomp.OnTerminated(running
 in main thread)  doesn't redraw the affected widgets, is it as
 designed ? Acc to the program logic, it should display the final
 statistics  results.

 PS:
 Me still can't get threading clearly :) A can of worms :)


 2012/7/26, Martin Schreiber mse00...@gmail.com:
 On Thursday 26 July 2012 08:28:29 Ivanko B wrote:
 What is the purpose of waitus(300)?
 
 For user to watch lblFinStatus.(caption  color).

 2012/7/26, Ivanko B ivankob4m...@gmail.com:
  Oops, it was becfuse of Application.terminated.
  =
  No, the code (lblFinStatus.* in threadcomp.OnTerminated) is entered,
  but the affected  widgets don't redraw after that code performed.
 
  So, the current solution is:
 
   lblFinStatus.*  waitus(..) - in threadcomp.OnTerminate
   ShowMessage  application.terminated -  in
  threadcomp.OnTerminateD
 
  works but feels not ideal.
 
 Looks OK for me. sleep() must run in worker thread, showmessage() in main
 thread because of Windows restriction.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Martin Schreiber
Am 26.07.2012 12:52, schrieb Ivanko B:
 The purpose of this command in the project is to delay exiting
   the whole program for a while after finishing all threads so that user
   can see the results.
 ==
 Hmm.. me terminate the application in one of its threads.
 What is Your opinion on proper build such kind of programs (serving a
 long running thread  then self-exiting with a delay before exit) ?

Self exiting the program or the thread? Ideally there should be no GUI 
code in worker thread.

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Martin Schreiber
Am 25.07.2012 05:24, schrieb Martin Schreiber:
 On Tuesday 24 July 2012 21:11:25 Ivanko B wrote:
   to move gui code in  main thread.
 =
 Any or particular type of GUI code ?

 On Windows any. Use application.lock/unlock in order to set common variables
 only, unless we can solve all Windows multithread API problems (no time at
 the moment).

git master 1bcf30af9eae1cca061e315d5bc37d2cfadc8226 uses 
application.synchronize() for showmessage(). The windows deadlocks are 
too difficult to be solved.

Martin


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-26 Thread Ivanko B
Self exiting the program or the thread?
==
The program.


2012/7/26, Martin Schreiber mse00...@gmail.com:
 Am 25.07.2012 05:24, schrieb Martin Schreiber:
 On Tuesday 24 July 2012 21:11:25 Ivanko B wrote:
   to move gui code in  main thread.
 =
 Any or particular type of GUI code ?

 On Windows any. Use application.lock/unlock in order to set common
 variables
 only, unless we can solve all Windows multithread API problems (no time
 at
 the moment).

 git master 1bcf30af9eae1cca061e315d5bc37d2cfadc8226 uses
 application.synchronize() for showmessage(). The windows deadlocks are
 too difficult to be solved.

 Martin


 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Wednesday 25 July 2012 09:50:35 Graeme Geldenhuys wrote:
 On 25 July 2012 05:19, Martin Schreiber mse00...@gmail.com wrote:
  It makes error reporting more complicated (global error codes etc).
 
  True, but the Windows architecture dictates constraints. I am not sure if
  all problems can be solved. On Linux it could work.

 It's not just Windows, other OSes have the same restrictions. Most GUI
 frameworks recommend/dictate that ALL gui work must be done within the
 main thread. Other threads can be used for any non-GUI work. This is
 quite normal behaviour in most, if not all, GUI frameworks. In fact, I
 don't think I know of any GUI framework which works otherwise.

Although it is not recommended, MSEgui on Linux can access X11 from worker 
threads, the necessary lock infrastructure is implemented. IIRC it worked on 
Widows too. I must check what has been broken. Probably I made extensions in 
window state tracking code which can deadlock.

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Wednesday 25 July 2012 12:47:23 Ivanko B wrote:
  Most GUI
  frameworks recommend/dictate that ALL gui work must be done within the
  main thread

 ===
 Even stepping/resizing progress bars ? How ?

For example with FPC Synchronize() (not the same as MSEgui 
application.synchronize().

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Wednesday 25 July 2012 12:45:45 Ivanko B wrote:
 Probably I made extensions in
  window state tracking code which can deadlock.
 ===
 Sure, the multi platform MSEgui should consistently provide same
 features for all supported platforms :)

Where is the money? ;-)

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
Where is the money?

Me mean if Win-32  LINUX are declared as currently supported then
they should behave  look same in MSEgui apps :)


2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Proposals:

 1) Smth like Python's threadqueue as multiple threads where each of
 has same OnExecute procedure but with per-thread data/object to
 process. With priorities within the queue, sure.
 [suitable for multiple file uploading..]

 2) maintaining thread variables so that they can be accessed by main
 app thread - in some scenarios it'll allow polling these variables
 instead of deadlock-prone locking/unlocking.


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Most GUI
 frameworks recommend/dictate that ALL gui work must be done within the
 main thread
 ===
 Even stepping/resizing progress bars ? How ?


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Probably I made extensions in
  window state tracking code which can deadlock.
 ===
 Sure, the multi platform MSEgui should consistently provide same
 features for all supported platforms :)



 2012/7/25, Martin Schreiber mse00...@gmail.com:
 On Wednesday 25 July 2012 09:50:35 Graeme Geldenhuys wrote:
 On 25 July 2012 05:19, Martin Schreiber mse00...@gmail.com wrote:
  It makes error reporting more complicated (global error codes etc).
 
  True, but the Windows architecture dictates constraints. I am not
  sure
  if
  all problems can be solved. On Linux it could work.

 It's not just Windows, other OSes have the same restrictions. Most GUI
 frameworks recommend/dictate that ALL gui work must be done within the
 main thread. Other threads can be used for any non-GUI work. This is
 quite normal behaviour in most, if not all, GUI frameworks. In fact, I
 don't think I know of any GUI framework which works otherwise.

 Although it is not recommended, MSEgui on Linux can access X11 from
 worker
 threads, the necessary lock infrastructure is implemented. IIRC it
 worked
 on

 Widows too. I must check what has been broken. Probably I made
 extensions
 in

 window state tracking code which can deadlock.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk





--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
For example with FPC Synchronize() (not the same as MSEgui
 application.synchronize().
===
What do they do ?


2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Where is the money?
 
 Me mean if Win-32  LINUX are declared as currently supported then
 they should behave  look same in MSEgui apps :)


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Proposals:

 1) Smth like Python's threadqueue as multiple threads where each of
 has same OnExecute procedure but with per-thread data/object to
 process. With priorities within the queue, sure.
 [suitable for multiple file uploading..]

 2) maintaining thread variables so that they can be accessed by main
 app thread - in some scenarios it'll allow polling these variables
 instead of deadlock-prone locking/unlocking.


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Most GUI
 frameworks recommend/dictate that ALL gui work must be done within the
 main thread
 ===
 Even stepping/resizing progress bars ? How ?


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Probably I made extensions in
  window state tracking code which can deadlock.
 ===
 Sure, the multi platform MSEgui should consistently provide same
 features for all supported platforms :)



 2012/7/25, Martin Schreiber mse00...@gmail.com:
 On Wednesday 25 July 2012 09:50:35 Graeme Geldenhuys wrote:
 On 25 July 2012 05:19, Martin Schreiber mse00...@gmail.com wrote:
  It makes error reporting more complicated (global error codes
  etc).
 
  True, but the Windows architecture dictates constraints. I am not
  sure
  if
  all problems can be solved. On Linux it could work.

 It's not just Windows, other OSes have the same restrictions. Most
 GUI
 frameworks recommend/dictate that ALL gui work must be done within
 the
 main thread. Other threads can be used for any non-GUI work. This is
 quite normal behaviour in most, if not all, GUI frameworks. In fact,
 I
 don't think I know of any GUI framework which works otherwise.

 Although it is not recommended, MSEgui on Linux can access X11 from
 worker
 threads, the necessary lock infrastructure is implemented. IIRC it
 worked
 on

 Widows too. I must check what has been broken. Probably I made
 extensions
 in

 window state tracking code which can deadlock.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk






--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Wednesday 25 July 2012 13:21:01 Ivanko B wrote:
 For example with FPC Synchronize() (not the same as MSEgui
  application.synchronize().
 ===
 What do they do ?

Run code in main thread.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Graeme Geldenhuys
On 25 July 2012 10:16, Martin Schreiber mse00...@gmail.com wrote:
 Although it is not recommended, MSEgui on Linux can access X11 from worker
 threads, the necessary lock infrastructure is implemented. IIRC it worked on
 Widows too.


Then that is truly impressive!


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Wednesday 25 July 2012 15:47:16 Graeme Geldenhuys wrote:
 On 25 July 2012 11:47, Ivanko B ivankob4m...@gmail.com wrote:
  Most GUI
  frameworks recommend/dictate that ALL gui work must be done within the
  main thread
 
  ===
  Even stepping/resizing progress bars ? How ?

 Yes. I have often used threads to notify the main thread to update a
 progress bar or other widgets for that matter. That is not hard. But
 setting the ProgressBar.Position property directly from the thread is
 where the trouble starts.

MSEgui tprogressbar.value is thread safe.

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
Hmm, me can't display [called but doesn't show] ShowMessage (to tell
about a cause why the app has just failed) in
threadcomp.OnTerminated and there's nowhere to display but this
place (my application blocks its terminating by any means but
threadcomp's application.terminated:= true which doesn't fire
application's OnTerminated - another possible place for
ShowMessage).


2012/7/25, Ivanko B ivankob4m...@gmail.com:
 For example with FPC Synchronize() (not the same as MSEgui
  application.synchronize().
 ===
 What do they do ?


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Where is the money?
 
 Me mean if Win-32  LINUX are declared as currently supported then
 they should behave  look same in MSEgui apps :)


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Proposals:

 1) Smth like Python's threadqueue as multiple threads where each of
 has same OnExecute procedure but with per-thread data/object to
 process. With priorities within the queue, sure.
 [suitable for multiple file uploading..]

 2) maintaining thread variables so that they can be accessed by main
 app thread - in some scenarios it'll allow polling these variables
 instead of deadlock-prone locking/unlocking.


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Most GUI
 frameworks recommend/dictate that ALL gui work must be done within the
 main thread
 ===
 Even stepping/resizing progress bars ? How ?


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Probably I made extensions in
  window state tracking code which can deadlock.
 ===
 Sure, the multi platform MSEgui should consistently provide same
 features for all supported platforms :)



 2012/7/25, Martin Schreiber mse00...@gmail.com:
 On Wednesday 25 July 2012 09:50:35 Graeme Geldenhuys wrote:
 On 25 July 2012 05:19, Martin Schreiber mse00...@gmail.com wrote:
  It makes error reporting more complicated (global error codes
  etc).
 
  True, but the Windows architecture dictates constraints. I am not
  sure
  if
  all problems can be solved. On Linux it could work.

 It's not just Windows, other OSes have the same restrictions. Most
 GUI
 frameworks recommend/dictate that ALL gui work must be done within
 the
 main thread. Other threads can be used for any non-GUI work. This is
 quite normal behaviour in most, if not all, GUI frameworks. In fact,
 I
 don't think I know of any GUI framework which works otherwise.

 Although it is not recommended, MSEgui on Linux can access X11 from
 worker
 threads, the necessary lock infrastructure is implemented. IIRC it
 worked
 on

 Widows too. I must check what has been broken. Probably I made
 extensions
 in

 window state tracking code which can deadlock.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk







--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
MSEgui tprogressbar.value is thread safe.
===
A list of all thread safe MSEgui widget's properties ?


2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Hmm, me can't display [called but doesn't show] ShowMessage (to tell
 about a cause why the app has just failed) in
 threadcomp.OnTerminated and there's nowhere to display but this
 place (my application blocks its terminating by any means but
 threadcomp's application.terminated:= true which doesn't fire
 application's OnTerminated - another possible place for
 ShowMessage).


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 For example with FPC Synchronize() (not the same as MSEgui
  application.synchronize().
 ===
 What do they do ?


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Where is the money?
 
 Me mean if Win-32  LINUX are declared as currently supported then
 they should behave  look same in MSEgui apps :)


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Proposals:

 1) Smth like Python's threadqueue as multiple threads where each of
 has same OnExecute procedure but with per-thread data/object to
 process. With priorities within the queue, sure.
 [suitable for multiple file uploading..]

 2) maintaining thread variables so that they can be accessed by main
 app thread - in some scenarios it'll allow polling these variables
 instead of deadlock-prone locking/unlocking.


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Most GUI
 frameworks recommend/dictate that ALL gui work must be done within
 the
 main thread
 ===
 Even stepping/resizing progress bars ? How ?


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Probably I made extensions in
  window state tracking code which can deadlock.
 ===
 Sure, the multi platform MSEgui should consistently provide same
 features for all supported platforms :)



 2012/7/25, Martin Schreiber mse00...@gmail.com:
 On Wednesday 25 July 2012 09:50:35 Graeme Geldenhuys wrote:
 On 25 July 2012 05:19, Martin Schreiber mse00...@gmail.com wrote:
  It makes error reporting more complicated (global error codes
  etc).
 
  True, but the Windows architecture dictates constraints. I am not
  sure
  if
  all problems can be solved. On Linux it could work.

 It's not just Windows, other OSes have the same restrictions. Most
 GUI
 frameworks recommend/dictate that ALL gui work must be done within
 the
 main thread. Other threads can be used for any non-GUI work. This
 is
 quite normal behaviour in most, if not all, GUI frameworks. In
 fact,
 I
 don't think I know of any GUI framework which works otherwise.

 Although it is not recommended, MSEgui on Linux can access X11 from
 worker
 threads, the necessary lock infrastructure is implemented. IIRC it
 worked
 on

 Widows too. I must check what has been broken. Probably I made
 extensions
 in

 window state tracking code which can deadlock.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk








--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
application.terminated:= true which doesn't fire
 application's OnTerminated
==
Oops, application's OnTerminateQuery

2012/7/25, Ivanko B ivankob4m...@gmail.com:
 MSEgui tprogressbar.value is thread safe.
 ===
 A list of all thread safe MSEgui widget's properties ?


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Hmm, me can't display [called but doesn't show] ShowMessage (to tell
 about a cause why the app has just failed) in
 threadcomp.OnTerminated and there's nowhere to display but this
 place (my application blocks its terminating by any means but
 threadcomp's application.terminated:= true which doesn't fire
 application's OnTerminated - another possible place for
 ShowMessage).


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 For example with FPC Synchronize() (not the same as MSEgui
  application.synchronize().
 ===
 What do they do ?


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Where is the money?
 
 Me mean if Win-32  LINUX are declared as currently supported then
 they should behave  look same in MSEgui apps :)


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Proposals:

 1) Smth like Python's threadqueue as multiple threads where each of
 has same OnExecute procedure but with per-thread data/object to
 process. With priorities within the queue, sure.
 [suitable for multiple file uploading..]

 2) maintaining thread variables so that they can be accessed by main
 app thread - in some scenarios it'll allow polling these variables
 instead of deadlock-prone locking/unlocking.


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Most GUI
 frameworks recommend/dictate that ALL gui work must be done within
 the
 main thread
 ===
 Even stepping/resizing progress bars ? How ?


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Probably I made extensions in
  window state tracking code which can deadlock.
 ===
 Sure, the multi platform MSEgui should consistently provide same
 features for all supported platforms :)



 2012/7/25, Martin Schreiber mse00...@gmail.com:
 On Wednesday 25 July 2012 09:50:35 Graeme Geldenhuys wrote:
 On 25 July 2012 05:19, Martin Schreiber mse00...@gmail.com
 wrote:
  It makes error reporting more complicated (global error codes
  etc).
 
  True, but the Windows architecture dictates constraints. I am
  not
  sure
  if
  all problems can be solved. On Linux it could work.

 It's not just Windows, other OSes have the same restrictions. Most
 GUI
 frameworks recommend/dictate that ALL gui work must be done within
 the
 main thread. Other threads can be used for any non-GUI work. This
 is
 quite normal behaviour in most, if not all, GUI frameworks. In
 fact,
 I
 don't think I know of any GUI framework which works otherwise.

 Although it is not recommended, MSEgui on Linux can access X11 from
 worker
 threads, the necessary lock infrastructure is implemented. IIRC it
 worked
 on

 Widows too. I must check what has been broken. Probably I made
 extensions
 in

 window state tracking code which can deadlock.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk









--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Wednesday 25 July 2012 17:18:43 Ivanko B wrote:
 MSEgui tprogressbar.value is thread safe.
 ===
 A list of all thread safe MSEgui widget's properties ?

Should be noted in code.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Wednesday 25 July 2012 17:19:34 Ivanko B wrote:
 application.terminated:= true which doesn't fire
  application's OnTerminated
 ==
 Oops, application's OnTerminateQuery

Call application.terminate instead. Application.terminated:= true does not 
call terminatequery because it can not be canceled.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
Should be noted in code.

what to egrep ?


2012/7/25, Martin Schreiber mse00...@gmail.com:
 On Wednesday 25 July 2012 17:18:43 Ivanko B wrote:
 MSEgui tprogressbar.value is thread safe.
 ===
 A list of all thread safe MSEgui widget's properties ?

 Should be noted in code.

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
Call application.terminate instead. Application.terminated:= true does not
 call terminatequery because it can not be canceled.
===
It [bypassing OnTerminateQuery] is done intentionally

- Pressing btnCancell puts the thread to terminate, its OnTerminated
at its very end sets appliation.terminated:= true
- closing the app {clicking [x] titlebar button etc} fires
application.OnTreminateQury which disables terminating the apllication
but the end of  thread code [making sure the graceful {proper cleanup
 result code} exit]

//
// Application.OnTreminateQuery
//
procedure tmainfo.appterminatequery(var terminate: Boolean);
begin
  terminate:= false;
  thrdUpdate.terminate;
end;

//
// Treadcomp.OnTerminate
//
procedure tmainfo.tdupadteterminate(const sender: tthreadcomp);
begin
// blocking the Cancel button since cancelling should be already in progress
btnCancel.enabled:= false;

// visual informing user about application results
case RESULTCODETY(ExitCode) of
  SUCCESS: begin
lblFinStatus.caption:= 'Завершено успешно.';
lblFinStatus.color:= cl_ltgreen;
pbCurrentFile.value:= 1;
pbTotals.value:= 1;
  end;
  CANCELLED: begin
lblFinStatus.caption:= 'Отменено.';
lblFinStatus.color:= cl_ltblue;
  end
  else {FAILED}
lblFinStatus.caption:= 'Произошла ошибка.';
lblFinStatus.color:= cl_ltred;
end;
application.unlock;
if ExitCode = integer(FAILED) then begin
  showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');  //  WANTED TO WORK
end;
waitus(300);
application.lock;

// the only way to exit the application , with no more questions  checks
application.terminated:= true;
end;


2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Should be noted in code.
 
 what to egrep ?


 2012/7/25, Martin Schreiber mse00...@gmail.com:
 On Wednesday 25 July 2012 17:18:43 Ivanko B wrote:
 MSEgui tprogressbar.value is thread safe.
 ===
 A list of all thread safe MSEgui widget's properties ?

 Should be noted in code.

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
Surprisingly:

//--
showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');  //  WANTED TO WORK
//--

doesn't even show in Appliation.OnTerminateQuery [was the 1st place tried]


2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Call application.terminate instead. Application.terminated:= true does not
  call terminatequery because it can not be canceled.
 ===
 It [bypassing OnTerminateQuery] is done intentionally

 - Pressing btnCancell puts the thread to terminate, its OnTerminated
 at its very end sets appliation.terminated:= true
 - closing the app {clicking [x] titlebar button etc} fires
 application.OnTreminateQury which disables terminating the apllication
 but the end of  thread code [making sure the graceful {proper cleanup
  result code} exit]

 //
 // Application.OnTreminateQuery
 //
 procedure tmainfo.appterminatequery(var terminate: Boolean);
 begin
   terminate:= false;
   thrdUpdate.terminate;
 end;

 //
 // Treadcomp.OnTerminate
 //
 procedure tmainfo.tdupadteterminate(const sender: tthreadcomp);
 begin
 // blocking the Cancel button since cancelling should be already in
 progress
 btnCancel.enabled:= false;

 // visual informing user about application results
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
   CANCELLED: begin
 lblFinStatus.caption:= 'Отменено.';
 lblFinStatus.color:= cl_ltblue;
   end
   else {FAILED}
 lblFinStatus.caption:= 'Произошла ошибка.';
 lblFinStatus.color:= cl_ltred;
 end;
 application.unlock;
 if ExitCode = integer(FAILED) then begin
   showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');  //  WANTED TO
 WORK
 end;
 waitus(300);
 application.lock;

 // the only way to exit the application , with no more questions  checks
 application.terminated:= true;
 end;


 2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Should be noted in code.
 
 what to egrep ?


 2012/7/25, Martin Schreiber mse00...@gmail.com:
 On Wednesday 25 July 2012 17:18:43 Ivanko B wrote:
 MSEgui tprogressbar.value is thread safe.
 ===
 A list of all thread safe MSEgui widget's properties ?

 Should be noted in code.

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk




--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Wednesday 25 July 2012 17:48:57 Ivanko B wrote:

   showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');  //  WANTED TO
 WORK end;
 waitus(300);

Use application.synchronize() for that code on Windows for now.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Graeme Geldenhuys
On 25 July 2012 15:43, Martin Schreiber mse00...@gmail.com wrote:

 MSEgui tprogressbar.value is thread safe.


My point was not specific to the TProgressBar. widgte Yes, MSEgui's
TProgressBar.Value property might be thread safe, but is every other
property of every MSEgui widget threadsafe too? Developers might get
the wrong idea and think so, and that is what I meant by where the
trouble starts.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Thursday 26 July 2012 00:11:57 Graeme Geldenhuys wrote:
 On 25 July 2012 15:43, Martin Schreiber mse00...@gmail.com wrote:
  MSEgui tprogressbar.value is thread safe.

 My point was not specific to the TProgressBar. widgte Yes, MSEgui's
 TProgressBar.Value property might be thread safe, but is every other
 property of every MSEgui widget threadsafe too? Developers might get
 the wrong idea and think so, and that is what I meant by where the
 trouble starts.

The hint was meant for IvankoB not for you. :-)

MSEgui has application.lock()/unlock(). After calling application.lock() it is 
possible to access GUI and other main thread properties from worker threads.

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Wednesday 25 July 2012 18:10:17 Ivanko B wrote:
 Use application.synchronize() for that code on Windows for now
 ===
 Where to place this call ?

Git master c60d3c2cfaadeac6c192b15944483b8453c7e94a has 
tthreadcomp.onterminated which runs in main thread by means of synchronize().

 Why me ask - ShowMessage is interactive command, me need to confirm
 that to proceed.

This is OK. showmessage() calls a nested main event loop.

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
threadcomp.onterminated which runs in main thread by means of synchronize().
==
Should threadcomp.onstarted do it too ?
(just a question)


2012/7/26, Martin Schreiber mse00...@gmail.com:
 On Wednesday 25 July 2012 18:10:17 Ivanko B wrote:
 Use application.synchronize() for that code on Windows for now
 ===
 Where to place this call ?

 Git master c60d3c2cfaadeac6c192b15944483b8453c7e94a has
 tthreadcomp.onterminated which runs in main thread by means of
 synchronize().

 Why me ask - ShowMessage is interactive command, me need to confirm
 that to proceed.

 This is OK. showmessage() calls a nested main event loop.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Thursday 26 July 2012 06:52:45 Ivanko B wrote:
 threadcomp.onterminated which runs in main thread by means of
 synchronize(). ==
 Should threadcomp.onstarted do it too ?
 (just a question)

I don't think so because starting a thread normally will be done in main 
thread.

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
1) still needs application.lock/unlock to redraw GUI elements
2) ShowMessage still doesn't show

//

procedure tmainfo.tdupadteterminate(const sender: tthreadcomp);
begin
btnCancel.enabled:= false;
case RESULTCODETY(ExitCode) of
  SUCCESS: begin
lblFinStatus.caption:= 'Завершено успешно.';
lblFinStatus.color:= cl_ltgreen;
pbCurrentFile.value:= 1;
pbTotals.value:= 1;
  end;
  CANCELLED: begin
lblFinStatus.caption:= 'Отменено.';
lblFinStatus.color:= cl_ltblue;
  end
  else {FAILED}
lblFinStatus.caption:= 'Произошла ошибка.';
lblFinStatus.color:= cl_ltred;
end;
application.unlock;
waitus(300);
if ExitCode = integer(FAILED) then begin
  showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');
end;
application.lock;
{выйти из программы по завершении sender.OnExecute}
application.terminated:= true; {не вызывает app.OnterminateQuery}
end;

2012/7/26, Martin Schreiber mse00...@gmail.com:
 On Thursday 26 July 2012 06:52:45 Ivanko B wrote:
 threadcomp.onterminated which runs in main thread by means of
 synchronize(). ==
 Should threadcomp.onstarted do it too ?
 (just a question)

 I don't think so because starting a thread normally will be done in main
 thread.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Martin Schreiber
On Thursday 26 July 2012 07:27:28 Ivanko B wrote:
 1) still needs application.lock/unlock to redraw GUI elements
 2) ShowMessage still doesn't show

And why don't you use the onterminated event I implemented especially for you?

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
Oops, it's a new event handler. Appzs !


2012/7/26, Ivanko B ivankob4m...@gmail.com:
 1) still needs application.lock/unlock to redraw GUI elements
 2) ShowMessage still doesn't show

 //

 procedure tmainfo.tdupadteterminate(const sender: tthreadcomp);
 begin
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
   CANCELLED: begin
 lblFinStatus.caption:= 'Отменено.';
 lblFinStatus.color:= cl_ltblue;
   end
   else {FAILED}
 lblFinStatus.caption:= 'Произошла ошибка.';
 lblFinStatus.color:= cl_ltred;
 end;
 application.unlock;
 waitus(300);
 if ExitCode = integer(FAILED) then begin
   showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');
 end;
 application.lock;
 {выйти из программы по завершении sender.OnExecute}
 application.terminated:= true; {не вызывает app.OnterminateQuery}
 end;

 2012/7/26, Martin Schreiber mse00...@gmail.com:
 On Thursday 26 July 2012 06:52:45 Ivanko B wrote:
 threadcomp.onterminated which runs in main thread by means of
 synchronize(). ==
 Should threadcomp.onstarted do it too ?
 (just a question)

 I don't think so because starting a thread normally will be done in main
 thread.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-25 Thread Ivanko B
Hmm..The lblFinStatus.* stuff doesn't redraw in OnTerminated:

//-
btnCancel.enabled:= false;
case RESULTCODETY(ExitCode) of
  SUCCESS: begin
lblFinStatus.caption:= 'Завершено успешно.';
lblFinStatus.color:= cl_ltgreen;
pbCurrentFile.value:= 1;
pbTotals.value:= 1;
  end;
[...]
waitus(300);
//-

application.unlock+lock doesn't help.


2012/7/26, Ivanko B ivankob4m...@gmail.com:
 Oops, it's a new event handler. Appzs !


 2012/7/26, Ivanko B ivankob4m...@gmail.com:
 1) still needs application.lock/unlock to redraw GUI elements
 2) ShowMessage still doesn't show

 //

 procedure tmainfo.tdupadteterminate(const sender: tthreadcomp);
 begin
 btnCancel.enabled:= false;
 case RESULTCODETY(ExitCode) of
   SUCCESS: begin
 lblFinStatus.caption:= 'Завершено успешно.';
 lblFinStatus.color:= cl_ltgreen;
 pbCurrentFile.value:= 1;
 pbTotals.value:= 1;
   end;
   CANCELLED: begin
 lblFinStatus.caption:= 'Отменено.';
 lblFinStatus.color:= cl_ltblue;
   end
   else {FAILED}
 lblFinStatus.caption:= 'Произошла ошибка.';
 lblFinStatus.color:= cl_ltred;
 end;
 application.unlock;
 waitus(300);
 if ExitCode = integer(FAILED) then begin
   showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ');
 end;
 application.lock;
 {выйти из программы по завершении sender.OnExecute}
 application.terminated:= true; {не вызывает app.OnterminateQuery}
 end;

 2012/7/26, Martin Schreiber mse00...@gmail.com:
 On Thursday 26 July 2012 06:52:45 Ivanko B wrote:
 threadcomp.onterminated which runs in main thread by means of
 synchronize(). ==
 Should threadcomp.onstarted do it too ?
 (just a question)

 I don't think so because starting a thread normally will be done in main
 thread.

 Martin

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond.
 Discussions
 will include endpoint security, mobile security and the latest in
 malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk




--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


[MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-24 Thread IvankoB
//-

application.lock;
try
showmessage('');
finally
application.unlock;
end;
//-

doesn't help here.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-24 Thread Martin Schreiber
On Tuesday 24 July 2012 13:54:08 IvankoB wrote:
 //-

 application.lock;
 try
 showmessage('');
 finally
 application.unlock;
 end;
 //-

 doesn't help here.

Works for me (Linux).

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-24 Thread Martin Schreiber
On 24.07.2012 14:28, Martin Schreiber wrote:
 On Tuesday 24 July 2012 13:54:08 IvankoB wrote:
 //-

 application.lock;
 try
 showmessage('');
 finally
 application.unlock;
 end;
 //-

 doesn't help here.

 Works for me (Linux).
On Windows the problem is that Windows locks on window operations from
different threads and IIRC there are event queues per thread. I'll check
if there is a possible solution.
Although it is not ideal to call GUI window code out of  the main
thread. Better to use application.synchronize() or to move gui code in
main thread.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-24 Thread Ivanko B
Better to use application.synchronize() or to move gui code in
 main thread.

It makes error reporting more complicated (global error codes etc).

 application.synchronize()

What does it do?

2012/7/24, Martin Schreiber mse00...@gmail.com:
 On 24.07.2012 14:28, Martin Schreiber wrote:
 On Tuesday 24 July 2012 13:54:08 IvankoB wrote:
 //-

 application.lock;
 try
 showmessage('');
 finally
 application.unlock;
 end;
 //-

 doesn't help here.

 Works for me (Linux).
 On Windows the problem is that Windows locks on window operations from
 different threads and IIRC there are event queues per thread. I'll check
 if there is a possible solution.
 Although it is not ideal to call GUI window code out of  the main
 thread. Better to use application.synchronize() or to move gui code in
 main thread.

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-24 Thread Ivanko B
 to move gui code in  main thread.
=
Any or particular type of GUI code ?



2012/7/25, Ivanko B ivankob4m...@gmail.com:
 Better to use application.synchronize() or to move gui code in
  main thread.
 
 It makes error reporting more complicated (global error codes etc).

  application.synchronize()
 
 What does it do?

 2012/7/24, Martin Schreiber mse00...@gmail.com:
 On 24.07.2012 14:28, Martin Schreiber wrote:
 On Tuesday 24 July 2012 13:54:08 IvankoB wrote:
 //-

 application.lock;
 try
 showmessage('');
 finally
 application.unlock;
 end;
 //-

 doesn't help here.

 Works for me (Linux).
 On Windows the problem is that Windows locks on window operations from
 different threads and IIRC there are event queues per thread. I'll check
 if there is a possible solution.
 Although it is not ideal to call GUI window code out of  the main
 thread. Better to use application.synchronize() or to move gui code in
 main thread.

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 mseide-msegui-talk mailing list
 mseide-msegui-talk@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-24 Thread Martin Schreiber
On Tuesday 24 July 2012 21:06:21 Ivanko B wrote:
 Better to use application.synchronize() or to move gui code in
  main thread.
 
 It makes error reporting more complicated (global error codes etc).

True, but the Windows architecture dictates constraints. I am not sure if all 
problems can be solved. On Linux it could work.

  application.synchronize()
 
 What does it do?

It runs the procedure/method in main thread.

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] ShowMessage doesn't show if called from within a thread's OnExecute

2012-07-24 Thread Martin Schreiber
On Tuesday 24 July 2012 21:11:25 Ivanko B wrote:
  to move gui code in  main thread.
 =
 Any or particular type of GUI code ?

On Windows any. Use application.lock/unlock in order to set common variables 
only, unless we can solve all Windows multithread API problems (no time at 
the moment).

Martin

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk