473,385 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Process.Show from a thread freezing 30 seconds

Hi All,

I'm a little new to .NET and I'm having a threading issue I'm
having a problem resolving/understanding.

I'm making a plug-in into Word. A menu-option ('Check Updates')
spawns a new thread which gathers information, and then displays a
form (modal, 'ShowDialog'). Once the form is Close() 'd, it tries to
run a system process - opens a website using:
openWebsite(url)
{
Process ^ newProcess = gcnew Process();
newProcess->StartInfo->FileName = url;
newProcess->StartInfo->CreateNoWindow = true;
newProcess->StartInfo->WindowStyle = ProcessWindowStyle::Normal;
newProcess->StartInfo->UseShellExecute = true;
newProcess->StartInfo->ErrorDialog = false;
newProcess->Start();
}

The thread spawned from the menu-option click is something as follows:
ThreadStart()
{
gather information;
MyForm ^ form = gcnew MyForm;
form->ShowDialog();
if(form->yes) openWebsite("http://whatever/");
}

The problem I'm having is that newProcess->Start() method freezes
for about 30 seconds before doing anything. What's interesting is
that I can open a website without a problem before running the
dialog, but not after:
ThreadStart()
{
gather information;
openWebsite("http://whatever/"); // works fine

MyForm ^ form = gcnew MyForm;
form->ShowDialog();

if(form->yes) openWebsite("http://whatever/"); // freezes 30
seconds
}

I thought maybe some events need to be processed, so I stuck a
'Application::DoEvents();' after the ShowDialog, but it did nothing.

Can anyone help?
Sincerely,
Andrew

Aug 2 '07 #1
0 1134

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
3
by: tshad | last post by:
I need to find out how many threads a process has. I have used ThreadPool.GetAvailableThreads and ThreadPool.GetMaxThreads, but they both show 50 for worker threads and 100 for port threads. ...
0
by: balach | last post by:
hi all, i am using this code to initialize and assign it to a process, i am calling a thread on every 10 Seconds to fire vbscript file, this activity is performed on "timer1_Tick( )" event and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.