Trying to show help files or url causes application hang

Hi,

I have a strange problem where if I try to show a chm help file my application locks up.
The application also hangs if I try to open a web page using process.start(url)
It also hangs if I try to show an OpenFileDialog.

This only happens when the application is installed on another machine (its ok on the dev machine)

I created another basic test application with the same functionality and it works fine.

I've tried help.showhelp(path to help file) and process.start(path to help file).
Also if I use process.start(url) then this also locks the application.

Double clicking on the chm file opens it fine so the chm file seems to be ok.  I can also open it by running a batch file, but this is a bit messy.  Also, this doesn't help with starting a url.

Anyone got any ideas of what could be wrong?
mikesteribarAsked:
Who is Participating?
 
JMoon5FTMCommented:
I don't think anyone's going to be able to fix it from here, but here are some things to consider.

The fact that this occurs only on the one machine means it's probably triggered by one of two things:

* Some other program has installed some type of hook that is interacting badly with your program.  If you can try uninstalling any unnecessary programs that aren't on your development machine.
* A difference in Windows configuration or a system policy setting

So you can try attacking the problem from that end, or look at ways of making your code less susceptible.   Specifically, review:

* any code that calls any COM system functions
* any COM-related attributes in the program
* any thread that performs user interface work and also calls Thread.Sleep (this pattern is to be avoided as it causes problems)

If you can, try installing Visual Studio or some other development tool on the problem computer so you can just-in-time debug your application.
0
 
JMoon5FTMCommented:
Just to make sure - when you say it's OK on the development machine, are you running the same EXE file (build vs. release) that the other machine uses, and are you running it outside of Visual Studio?

For the record, you can in fact start a URL from a batch file, like so:

start http://www.google.com/

Obviously creating and running batch files isn't ideal, so I'll be thinking about your problem some more - but if all else fails this will work.
0
 
JMoon5FTMCommented:
Does your Main() function have the [STAThread] attribute?
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
CodeCruiserCommented:
Just to isolate the problem, does it work if you try something else with process.start, such as a jpg file or a txt file?
0
 
mikesteribarAuthor Commented:
Hi, Thanks for the comments so far...  I've done some testing based on them ->

>>  are you running it outside of Visual Studio?  -Yes, on the dev machine, it runs both inside and outside Visual Studio.
>>  Does your Main() function have the [STAThread] attribute?  -I was just using a form as startup object, so no sub main and enable app framework was checked.  Tried creating a startup class with sub main, with and without [STAThread].  Didn't make any difference.
>>  does it work if you try something else with process.start, such as a jpg file.  - No - it hangs whenever I use process.start (e.g. process.start("C:\test.txt").  It also hangs whenever I try to use an openfile dialog, e.g dim o as new openfiledialog, o.showdialog causes it to hang.

So, the application hangs if I try to use any openfile dialog or process.start(anything) and help.showhelp.
0
 
CodeCruiserCommented:
That is really strange. Do you have full permissions on the machine you are running it?
0
 
mikesteribarAuthor Commented:
>>Do you have full permissions on the machine you are running it - Yes, I think so.  If I create a new project (on the same dev machine) with a process.start call then it works on the same test machine where the other app is failing.  I think this suggests that it is something to do with the application rather than the test machine?
Also, this application did work - something must have changed.  I'm guessing (and its a very vague guess) that it is either some obscure setting in visual studio, or, something has got screwed up in the way this application is being compiled somehow.
0
 
CodeCruiserCommented:
Could not think of anything.
0
 
mikesteribarAuthor Commented:
Hi JMoon,

I started checking the COM functions as per your advice:  I use several COM controls, one of which creates a virtual serial port.

If I remove this from my app, then everything works fine and re-adding it starts the problem again so it definately looks like the problem.

I'm going to contact their tech support guys and see if they can help.

Thanks everyone for your time and advice :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.