I've developed of software which consists, in a first configuration window which parse a ini file at his startup.
Using C# with WPF library.
If parsing it is correct the window is closed immediately and a second window is displayed.
The application runs correctly on Windows 8.
When i run the application on a Windows 7 PC a ENTRY POINT NOT FOUND EXCEPTION it is thrown. Following the code which throws exception from configuration window.
if(parse()){ //parse() returns true if it is correct
MainWindow w = new MainWindow(); //here where the exception is thrown
w.Show();
Close();
}
I've made the following attempts:
I've tried the following procedure, but it did not work:
http://answers.microsoft.com/en-us/windows/forum/windows_7-system/exe-entry-point-not-found/5b0866c1-8e45-457e-a83c-651c1fd307cc.
I've tried to develop a new WPF project, with two window.
In the start up window i've added a simple button which display the second window, in the same way as shown. And it runs correctly.
I suspect that in my project something is wrong.
And the entry point of the window that i'm trying to display is not well defined, but i'm not able what exaclty is wrong.
Build -> Configuration Manager -> Acitve solution platform -> New -> x86 (instead of x64) This helped to me.
Related
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.
I'm working in Visual Studio 2013 Premium on a Windows forms project. When I'm debugging my windows forms project and I close my start up form, all other forms stop too. I googled this problem and saw that in project --> properties there is a drop down list where you're able to change shutdown mode, which would solve my problem.
The shutdown mode option however is not present at my application properties. I can't find it anywhere else and searching the web didn't resolve this problem for me either, so what could it be?
That only applies to Visual Basic projects.
Here's your options:
For Visual Basic projects, twiddle the option you found on Google
For C# WPF projects, you can set the Application.ShutdownMode property
For C# WinForms projects, you must either:
Accept that it will close when the main form closes
Prevent the main form from closing until all other forms have closed
The Application.OpenForms Property should be helpful to you:
Definition:
Gets a collection of open forms owned by the application.
Example:
In the closing event of the main application you can put following code that will check if there's more than 1 form opened.
var openForms = Application.OpenForms;
if(openForms.Count > 1)
{
//More than 1 form is opened: cancel the close-event
}
else
{
}
I'm new to WPF and have a question which quite same with the article: "Walkthrough: Debug a WPF window or Windows Form without running your application".
The link: http://blogs.msdn.com/b/habibh/archive/2009/07/17/walkthrough-debug-a-wpf-window-or-windows-form-without-running-your-application-video.aspx
I will take the picture as an example:
http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/DebugaWPFwindoworWindowsFormwithoutrunni_FD38/image_3.png
From the picture, the project have 4 WPF windows such as:
App.xaml
Create...so on.xaml
MainWindows.xaml
ViewChart... so on.xaml
When every time in VS 2010, I click on the starting debugging (F5) or start without debugging(Ctrl + F5) will always run the MainWindows.xaml. What the reason coz this? Is this because of in the App.xaml that we declare StartupUri="MainWindow.xaml".
Can I run the particular WPF windows such number 4. ViewChart... so on.xaml instead of the whole application(*Such as the MainWindows.xaml)?
The article you linked is out of date and the video that demonstrates his solution is no longer hosted. However, the basic steps that were outlined in the video are still possible, though the process can be more trouble than it's worth.
The process is as follows:
Open the Immediate Debugger window (Debug -> Windows -> Immediate Window)
In the Immediate mode, create an instance of the window you are wishing to test.
call the ShowDialog() method on your Immediate instance.
The main trouble with this method of debugging is that if your window has a complex constructor or has dependencies on external objects, you may end up spending more time setting up the dependencies than just navigating to the page would have taken.
I've created a custom charting control for windows forms and I'm now trying to debug it since it's not working.
I've had to switch to Console application type, and write Console.WriteLine statements everywhere to find what's going on. In this case my code tries to access a negative index of an array. Yet NOTHING pops up with the debugger. Instead the application just shows a big red X and stops drawing/calculating/ect as proven by my console.writeline statements.
My project was started as a Windows Forms application. It consists of a few classes along with a ChartControl (my control) inheriting from user control. And I'm using the default form to test it that came with the Windows Forms application.
When I debug it just runs the windows form which always stays in focus with no pop ups or notifications coming from visual studio. The Locals and Call Stack in visual studio remain faded out / empty. Yet I know for a fact that the application is dead-stop in its tracks after trying to use a negative index value. Sorry I don't know what to do, or how to see what is going on.
Does anyone know what is going on and how I can get debugging information?
Update:
I've found a window called output that seems to show stuff from the debugger. And I get:
"A first chance exception of type 'System.IndexOutOfRangeException' occurred in....(Name.exe)"
However as you can see it does not show the location or anything like that. Interesting.....
In VS, select Debug menu > Exceptions... and ensure the correct types are selected.
I have tried two installers - Setup2go, and Installmate Builder, and I have the same problem. At the last window of the install, I select the option to "Open program after installation finish", and sometimes (about 10% of the time?), my (Winforms) app's main window will open behind the Windows Explorer directory window I used to open the installation exe from.
The frustrating thing is - I am having trouble reproducing the problem reliably (the problem seems to occur around 10-20% of the time). I am using Windows 7 if that makes any difference. To clarify, if I open up the executable directly (rather than from the installation exe), the problem never occurs.
My knowledge on this kind of thing is limited - I recall a similar frustration happening with the MessageBox from this question
Any ideas?
It does not happen when you launch the app directly from installer because the shell allows it to “steal” the focus. When you launch it from the installer, the last interaction happens in the installer app. The system prevents the new window from stealing the focus from your installer. If installer window closes, then the explorer window which you used to start the installer is activated. Since the switch of the foreground window happened recently, the system does not allow to change the foreground window.
On the other hand, if your application window is shown before the installer window disappears from the screen, the the app will be placed below the installer in the Z-order; and when the installer window is finally hidden, the application window is activated.
So it's all related to timing between showing and hiding windows.
Although I am not expert in this area. You can use message tracers and WinAPI calls tracers like Spyxx which can give you more details on what happens in the system and why the new window of your application is placed below the Explorer window.
Make sure the window's title isn't changed, until the last possible moment. I moved the Text = "blahblah" line out of the Form_load event, and into the Form1_Shown event, and now the hidden taskbar icon problem has vanished. Also, the window doesn't flicker when it's loading.