Re: Multithread and UI again ! :)

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



Hi,

Can it be that you construct the second form on a worker thread?

The Invoke method can also be tricky - make sure that the control on which you call Invoke was created on the main UI thread.

--
Regards,
Dmytro Lapshyn [MVP]
http://blogs.vbcity.com/DmytroL

"maxima" <maxima@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:8B3E9653-A02B-42A1-BA29-97CF3626BE30@xxxxxxxxxxxxxxxx
Hi,

I have done some coding with UI being accessed from different threads before.

But now I stuck. Need your help guys! :)

My application run not the form but some ApplicationContext class (in
function Main - Application.Run(new MyAppContext());)

That class creates 2 children. Model1 and Model2. Model1 being created in
MyAppContext constructor. In a turn frmMain being created in model1's
constructor as well..

So frmMain has no problem at all..

Model2 could be created in 2 different methods of MyAppClass. They being
called from Model1. In such a case (in Model2's constructor) frmSecond being
created and shown.

When it goes to method1 - frmSecond works fine. When it is from method2 -
frmSecond popping up to the screen but white and doesnt show anything.

All the methods which access UI in frmSecond - all are through Invoke thing.
So everything still works (I can see it in debuger). But doesnt show anything
on screen :(

Please help! :)

.



Relevant Pages

  • Re: Dynamic inheritance
    ... >> to invoke the development portion of the IDE to modify the tree and ... > That's not the case in Smalltalk, ... properties at run time when the constructor is invoked. ... repository, modify the tree with the existing IDE tools, and then let ...
    (comp.object)
  • Re: Calling a constructor from another
    ... instantiated is a composite of all the properties in all classes in the direct line of ascent in the subclassing tree, the usual technique is to provide a constructor for each class to handle that class' properties and invoke them in a nested fashion. ... While using the Factory pattern ... the method responsibilities they need to invoke constructors. ...
    (comp.object)
  • Re: Detecting wich method was called in a WS contructor
    ... It's true there is a pending invocation of a webmethod when the constructor ... Callers invoke ... > of Web Services, so I created a couple of standard classes in order to ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Invoke a superclass method from a subclass constructor
    ... An instance of my subclass doesn't invoke its superclass method, ... In B's constructor, you create a new instance of A (a pointless ... use its "super" function as an excersise to the reader. ...
    (comp.lang.python)
  • Re: 2 initializers in 1 constructor
    ... the dot not compiler does allow us to invoke 2 constuctors(whether the ... you have to invoke one of the constructor defined by the ... would become unreached oblect. ... When you call a sibling constructor, it calls a base constructor. ...
    (microsoft.public.dotnet.languages.csharp)