[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Display 2nd window while create background task

Posted on 2011-02-17
6
Medium Priority
?
292 Views
Last Modified: 2013-12-17
Hi,

I don't understand why my 2nd window not appearing while I can background task:

     private void button1_Click_2(object sender, System.EventArgs e)
        {
            FirmWare fw = new FirmWare("gvruwebtester.dll", null, "gvruwebtester.dll");
           
            Initialization frmInit = new Initialization();
            frmInit.Show();   <---- not showing ??????
            // frmInit.progressInit.Visible = true;
            bgw.RunWorkerAsync(fw);
        }

Thanks,
JT
0
Comment
Question by:jtran007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 10

Assisted Solution

by:ALaRiva
ALaRiva earned 600 total points
ID: 34921980
What code do you have running in the constructor of that class?

Is it appearing AFTER the code runs? Or never opens at all?

My assumption would be that you are running all of your code in the constructor and then dumping the form after, which essentially means that you will never see the form.

More details please.

- Anthony
0
 
LVL 11

Accepted Solution

by:
Sudhakar Pulivarthi earned 1400 total points
ID: 34922152
Hi try this.

private void button1_Click_2(object sender, System.EventArgs e)
        {  
            Initialization frmInit = new Initialization();
            frmInit.Show();
            // frmInit.progressInit.Visible = true;

            FirmWare fw = new FirmWare("gvruwebtester.dll", null, "gvruwebtester.dll"); // This might be the problem causer, please check whether its returning / taking long time.
            bgw.RunWorkerAsync(fw);
        }
0
 

Author Comment

by:jtran007
ID: 34922724
Hi,

I just put delay time after show. Then my second window appears. I don't understand why.
Anyway it solves my problem. Thanks.
JT
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 3

Expert Comment

by:chandra_darbha
ID: 34923033
That means, the application thread is getting busy executing the FirmWare constructor and hence the Form is not getting displayed. Looking at the constructor parameters it gives a feel of Assembly loading etc., Reflection API. Are you doing any reflection in the constructor?

Thanks,
Chandra
0
 

Author Comment

by:jtran007
ID: 34925860
Hi,

No.I don't use reflection. Just initialize serial port.

Cheers,
JT
0
 

Author Closing Comment

by:jtran007
ID: 35380729
Thanks,
JT
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question