Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Thu, 28 Aug 2008 21:08:55 -0700 (PDT),    group: microsoft.public.dotnet.framework.windowsforms        back       


Creating and returning a form from a thread - C# 2.0   
Hello All,

We have two applications in .NET 2.0 C#.

App1  communicates with App2 throught App2's COM layer. App1 has the
ability to load some of the forms exposed by App2.

The problem is when the user tries to load the form from App2 for the
first time the whole GUI freezes up as the UI thread gets busy in
loading all the dlls etc and it sometimes takes up to 2~3 mins. to
load one form. Once all the Dlls are loaded the performace of loading
forms from App2 improves.

I tried to put the form loading calls into a worker thread and am
showing a progress window, this keeps my main thread responsive and
when the form is created I save its reference in a class level
variable to access it from main thread after the worker has stopped.
The problem is when the worker thread is done loading the form and I
call the Thread.Join, the form that I got from App2 also gets killed.

I think it is related to that windows rule that says the control will
only exist in the thread that creates it.

Any ideas how to solve this problem?
date: Thu, 28 Aug 2008 21:08:55 -0700 (PDT)   author:   unknown

Re: Creating and returning a form from a thread - C# 2.0   
My first move would be first to check why it takes 2-3 minutes. This is not 
something that looks like a normal behavior to me. Adding threading would 
hide the problem rather than solving it and then you'll have the added 
complexity of running the UI into several threads and AFAIK this is really 
not an usual situation...

--
Patrice


 a écrit dans le message de groupe de discussion : 
a303ecb5-9bd6-4cdf-9c5b-9dc3e97e3c0f@i20g2000prf.googlegroups.com...
>
> Hello All,
>
> We have two applications in .NET 2.0 C#.
>
> App1  communicates with App2 throught App2's COM layer. App1 has the
> ability to load some of the forms exposed by App2.
>
> The problem is when the user tries to load the form from App2 for the
> first time the whole GUI freezes up as the UI thread gets busy in
> loading all the dlls etc and it sometimes takes up to 2~3 mins. to
> load one form. Once all the Dlls are loaded the performace of loading
> forms from App2 improves.
>
> I tried to put the form loading calls into a worker thread and am
> showing a progress window, this keeps my main thread responsive and
> when the form is created I save its reference in a class level
> variable to access it from main thread after the worker has stopped.
> The problem is when the worker thread is done loading the form and I
> call the Thread.Join, the form that I got from App2 also gets killed.
>
> I think it is related to that windows rule that says the control will
> only exist in the thread that creates it.
>
> Any ideas how to solve this problem?
>
>
>
date: Fri, 29 Aug 2008 11:10:34 +0200   author:   Patrice http://www.chez.com/scribe/

Re: Creating and returning a form from a thread - C# 2.0   
On 29 Aug, 17:10, "Patrice" <http://www.chez.com/scribe/> wrote:
> My first move would be first to check why it takes 2-3 minutes. This is not
> something that looks like a normal behavior to me. Adding threading would
> hide the problem rather than solving it and then you'll have the added
> complexity of running the UI into several threads and AFAIK this is really
> not an usual situation...
>
> --
> Patrice
>
>  a écrit dans le message de groupe de discussion > a303ecb5-9bd6-4cdf-9c5b-9dc3e97e3...@i20g2000prf.googlegroups.com...
>
>
>
>
>
> > Hello All,
>
> > We have two applications in .NET 2.0 C#.
>
> > App1  communicates with App2 throught App2's COM layer. App1 has the
> > ability to load some of the forms exposed by App2.
>
> > The problem is when the user tries to load the form from App2 for the
> > first time the whole GUI freezes up as the UI thread gets busy in
> > loading all the dlls etc and it sometimes takes up to 2~3 mins. to
> > load one form. Once all the Dlls are loaded the performace of loading
> > forms from App2 improves.
>
> > I tried to put the form loading calls into a worker thread and am
> > showing a progress window, this keeps my main thread responsive and
> > when the form is created I save its reference in a class level
> > variable to access it from main thread after the worker has stopped.
> > The problem is when the worker thread is done loading the form and I
> > call the Thread.Join, the form that I got from App2 also gets killed.
>
> > I think it is related to that windows rule that says the control will
> > only exist in the thread that creates it.
>
> > Any ideas how to solve this problem?- Hide quoted text -
>
> - Show quoted text -

Patrice,

The slow loading on first call is due to the fact that App2 connects
to different systems to load the cache data that is needed by the
form.

So we cannot do anything about that.

Nad
date: Sun, 31 Aug 2008 23:17:36 -0700 (PDT)   author:   unknown

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us