VS2012 C# - vshost32 has stopped working - c#

I have a windows form application which is basically a PDF viewer. I used the Adobe PDF Viewer COM component for this project.
The program works but I'm having an issue when I click the close button on the top right of the form after I open a pdf file. When I click the close button, VS does not exit the 'run'-mode and I have to manually click the 'stop' button on VS. And when I press the stop button, a window pops saying "vshost32 has stopped working".
However, this does not happen when I run the application and close it without opening a pdf file.
Any idea why this happens?

You may have manually release the COM object by using Marshal. See this link: http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.releasecomobject.aspx

The vshost32.exe is related to designer-simulation tasks in window forms, so try creating a new project then improt your classes from the old one.

Related

Weird Selenium Click Behaviour C#

I am automating a website using Selenium.
I have made a Console Application using C# in Visual Studio.
In that I execute a click on an element. The click should open a new window.
But, it doesn't.
If I close the console window to stop the project, the desired window which should have opened on the click, opens up now.
Earlier, this used to work all fine. But this problem has occurred recently. There has been no change in the code.
Browser is Internet Explorer.
Anyone knows what could have caused such a behavior and how to fix it ?
Do the 2 pc have different screen sizes? If the element is not shown on the page, the 1st click will bring you to the element, but not click it.

Excel trying to"Recover your information" - WinForm in Excel Add-in

Can any one help me with this?
I created a simple Excel add-in (using VS2012, Excel 2013, C#)
the Add-in has only a simple ribbon with 1 button and 1 simple form.
when the user clicks the button, the form is shown.
The thing is that when the user closes Excel, the attached image is displayed.
I replicated this by creating a Blank form that does nothing, but still the "Recovering your work" still appears.
this is the button-click event
Form1 f = new Form1();
f.ShowDialog();
After looking for windows Event Viewer, it turned out that "TitleBarDLL.dll" is causing Excel to crash.
investigating this file, it turned out that the problem is caused by Samsung Dual Monitor application (which installs with the monitor driver). Exiting/disabling the application fixes the issue.

Form behaviour in windows compact framework

I am altering an existing windows compact framework application and i did most of the part and i noticed the different behavior of the form.
Consider i am Opening my application, "ApplicationForm" is the main form and on clicking Next button in ApplicationForm another form say "NextForm" will open.I am using below code to open the NextForm.
NextForm obj = new NextForm();
obj.Showdialog();
Now NextForm screen is in open and at this time if I open FileExplorer in device,FileExplorer will open.Now if i Open my installed application from device from Start menu,the application opens with the last open Form say NextForm.It will show NextForm in screen but from here if i click Back button in NextForm it is taking me to FileExplorer.Actually it should take me to ApplicationForm and it works fine when FileExplorer is not opened.
1.I need to navigate to ApplicationForm if i click Back button in NextForm even if FileExplorer is opened in the above scenario.
2.Is it possible to set like this,even the application is opened and the user is in any say NextForm form,when user click application from Start menu it should open the ApplicationForm(which is the Main form) and all other form(NextForm) should close automatically.
Is it possible to solve this issue.

How to handle embedded flash active x control script errors?

I have a winForm panel that has a flash ative x control embedded in it. This works pretty well.
I load the form, add the flash control to the form, then load the .swf file that I wish to play. However, I have a few issues. There is a button in the swf file that is loaded that is marked with an 'x' to denot that it should close the flash plugin.
When this button is clicked it pops an internet explorer window and then shows an error dialog box that says: "Internet Explorer cannot download . Unspecified error"
There is also a 'Continue' button in the flash movie that shows when the movie is over, and it produces the same behavior when the button is clicked.
For this project we are trying to aviod the usage of the WebBrowser control to host the flash video.
Does anyone have any solutions that would allow the application to handle a call that opens a new internet explorer window?
EDIT: I have found more details as to what specifically the issue is. The flash file (.swf) has an embedded call to IE:
javascript:window.close()
This particular call is causing the IE window to pop and then fail. We do not have the ability to change the flash file, is there anyway to handle this call from the windows form and stop it from happening?
Did you steal this SWF?
But to answer you change your embed code.
attributes.allowscriptaccess = "never"

C# Windows not opening on top

I've written a relatively large application with lots of dialog boxes and forms, etc.
I'm opening them with Form.ShowDialog().
A lot of the time, the forms open behind existing windows, e.g. yesterday I was testing it on a machine with several other programs open: many Windows Explorer windows, a few Excel windows, etc. A lot of my forms, open/save file dialogs, etc were supposed to open but didn't. I was twiddling my thumbs until I pressed alt+tab and realised that they were, in fact, behind another window.
Why is this happening, and how can I stop it in future? Thanks.
Use the ShowDialog override which takes an owner window as a parameter.
By passing in your main window as the dialog's owner, you guarantee that the dialog always pops in front of it, and stays in front of it.
And it won't annoy the user if they were using some other application.

Categories