Re: ShowDialog and asynchronous code execution

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dennis Sjogren (lakebranch_at_REMOVE_THIS.gmail.com)
Date: 10/13/04


Date: Wed, 13 Oct 2004 13:02:15 +0200

Cor,

> I made this sample a week ago, look through it, it uses two methods to show
> to seperated splash screens.

Looking at your code inspired me to try the multithreaded approach
again. After much gnashing of teeth, I finally have a working solution.
It uses a wrapper class that manages my status windows. It has a Show()
method that creates a new status form in it's own thread. The wrapper
also has a Hide() method which uses Invoke (which should be safe in a
threaded environment) to call the Close method of the status form in
question.

I've used Thread.Name and Debug to verify that no method calls are
beging done over thread boundaries.

This is how I use it:

   Private BusyWindow as New frmBusyWindow(Me)
   BusyWindow.Show("Searching...")
   .
   . <CODE>
   .
   BusyWindow.Hide()

Note: frmBusyWindow.Show(Text as String) returns immediately after
starting the new thread, which makes the status window appear at the
same time as the code following the Show call executes.

Thanks for inspiring me!

Regards,

/dempa



Relevant Pages

  • Re: pioneer DVD-RW DVR-106D still no solution to this issue**
    ... Did you try going to system propertys and then Device manager and right ... > any working solution to my problem. ... > properly, such as autoplay not working or if I insert a cd/dvd there, ... > windows will not read the disk until I restart. ...
    (microsoft.public.windowsxp.hardware)
  • Re: GDI/GDI+ stop drawing after a while on Windows 7
    ... works fine on Windows XP and Windows Vista, ... Windows 7 I get GDI leaks. ... I have not been able to find a working solution. ... not quite ready yet (hardware, drivers, decoders, etc.) to run 24x7. ...
    (microsoft.public.vc.mfc)
  • [PHP] PHP XSLT caching
    ... On my web server ... I was thinkging about memcahce php(dunno if it will work on windows ... So i am sure that there must be several ways to cash xslt files. ... if someone already have a good working solution i would appreciate ...
    (php.general)
  • discjuggler cdi image
    ... I've been given a dvd of images that are in disc juggler *.cdi format ... Ive googled around but not found any working solution I have no windows ...
    (freebsd-questions)
  • exposing a hWnd in a wrapper class for Windows.Form
    ... I've got an ActiveX container control that claims to be able to host ... Windows Forms windows. ... by creating a wrapper class. ... The host control is Innovasys ...
    (microsoft.public.dotnet.framework.interop)