.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Why Application.ThreadException does not work with message filters?

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :Windows Application
 

Hi,

I attached a handler to the Application.ThreadException and added a message filter to the Application.

The message handler throws exception and I want to handle these exceptions in the the Application.ThreadException handler.

But for some reason they are unhandled.

If you run the code below you will see "AppDomain.UnhandledException: ...".

Form1 is just an empty form.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;

namespace HotkeyTest
{
  static class Program
  {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);

      Application.ThreadException += new ThreadExceptionEventHandler(application_ThreadException);
      Applicatio


View Complete Post


More Related Resource Links

replacing ok and cancel button of an alert message with YES an NO button in asp.net web application.

  

i want to replace ok and cancel button of an alert message with YES an NO button in asp.net web application.When a user will click yes the data will be saved in the database and if user clicks that will act as a reset button and do not save the data in database and the control will move with as usual to the redirect page.Any pointers will be highly appreciated.I am usin g C# language.


How to get the 32 Bit Application to work on 64 bit OS

  
  Hi,         I had wrote a program in 32 bit OS using VS2010 and had to install it on a 64 bit OS. The program crashes when it is opened.   Developer PC: Microsoft Windows Vista SP2 32 bit Tool & Compiler: Microsoft Visual Studio 2010, Configuration : Any CPU Target PC: Microsoft Windows 7 Home Premium 64 Bit The Log is like this below:   Description:   Stopped working Problem signature:   Problem Event Name: CLR20r3   Problem Signature 01: aiassociates.exe   Problem Signature 02: 1.0.0.0   Problem Signature 03: 4c5bdd9e   Problem Signature 04: System.Data   Problem Signature 05: 2.0.0.0   Problem Signature 06: 4a274a01   Problem Signature 07: 205a   Problem Signature 08: 5f   Problem Signature 09: System.InvalidOperationException   OS Version: 6.1.7600.2.0.0.768.3   Locale ID: 18441 Read our privacy statement online:   http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409 If the online privacy statement is not available, please read our privacy statement offline:   C:\Windows\system32\en-US\erofflps.txt     renjith

"Server Application Unavailable" message appeared?

  
Hi there,I visited the admin area of my web application this morning and a message appeared saying "Server Application Unavailable" and that I needed to check the event log for more information.I was just wondering if there was any reason this might have appeared? I solved it by restarting the application pool but I can't figure out why this appeared.Thanks.

Update in formview doesn't work, but I don't get an error message?

  
I have a datasource:<asp:SqlDataSource ID="MySQLProfielDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:WAPMySQLConnStr %>" InsertCommand="INSERT INTO usergegevens(UserId, Geslacht, Voornaam, Tussenvoegsel, Achternaam, Adres, Huisnummer_toev, Postcode, Woonplaats, TelnrV, TelnrM, Geboortedatum) VALUES (@Param1, @Param2, @Param3, @Param4, @Param5, @Param6, @Param7, @Param8, @Param9, @Param10, @Param11, @Param12)" ProviderName="<%$ ConnectionStrings:WAPMySQLConnStr.ProviderName %>" SelectCommand="SELECT UserId, Geslacht, Voornaam, Tussenvoegsel, Achternaam, Adres, Huisnummer_toev, Postcode, Woonplaats, TelnrV, TelnrM, Geboortedatum FROM usergegevens WHERE (UserId = @Param1)" UpdateCommand="UPDATE usergegevens SET Geslacht = @Param1, Voornaam = @Param2, Tussenvoegsel = @Param3, Achternaam = @Param4, Adres = @Param5, Huisnummer_toev = @Param6, Postcode = @Param7, Woonplaats = @Param8, TelnrV = @Param9, TelnrM = @Param10, Geboortedatum = @Param11 WHERE (UserId = @Param12)" onselecting="MySQLProfielDataSource_Selecting" onupdating="MySQLProfielDataSource_Updating" onselected="MySQLProfielDataSource

SMS message from a vb.net application

  
Hi, I need to send a SMS from a vb.net application. It seems you need a SMS gateway to send such messages? Any other ways to send messages or is it the only way to send?   Thanks.

Calling a Web Service Method Asynchronously does not work in Console Application

  
I have a web service that has a CreateReport method that generates a report based on the specified criteria. When I call this method Synchronously using a Windows Application or Console Application, the call works fine and the report is created. When I call this method ASynchronously (CreateReportASync) using Windows Application the report is created. When I call this method ASynchronously (CreateReportASync) using Console Application the web service does not even get the call.  I am using VS2005 and .Net Framework 2.0.  So the proxy is automatically created with the Async methods.  I am not really interested the result of the method call, so I do not add a Callback Delegate.  

What is the best way to develop a multi-page Windows Application (i.e. work like a web app - no pop-

  
Hi, I have implemented a toolstrip and want to use this as my menu to change current page (just like a web application). I DON'T want extra forms popping up.    I ask this question as in the past I have always used TAB Control, but now that I'm using the toolstrip I don't require the Tab Buttons themselves. Can I hide these buttons, during runtime. Obviously I only need one tab displayed at a time. I have looked at using a panel, but that means I can't flick between panels during design stage. Any suggestions would be really appreciated. Thanks. John.      

Report filters do not work, ALL data is returned

  
Hello, I'm facing a weird problem with a Report Builder 1.0 report. The report has two filters: a Start Date and an End Date. I have selected the "prompt" property of these filters to use them as report parameters. When I run the report in Test, it runs just fine and shows correct data as per selected filters. When I copy the report to Production, it again runs fine. The problem begins if I try to make any changes to the report in Production. I open the report in RB 1.0 and add another column. When I now run the report, it returns ALL the records in the DB regardless of the Start Date and End Date specified. Strangely, this does not happen when I change the report in the test environment. Any ideas on why this could be happening will be very much appreciated! Thanks, Shivani

Windows Forms application Stopped Working message in Windows Vista

  

Issue:

A Windows Forms application developed with VB2008 Express that has been successfully run on two Windows XP systems and a Windows 7 system fails to run on two of two Windows Vista systems tried so far.

Details:

Attempting to run the app on a Windows Vista system results in a system dialog box titled, Microsoft Windows, with the message, A problem caused the program to stop working correctly.  Windows will close the program and notify you if a solution is available.  A single button at the lower right of the dialog contains the text, Close Program.
The initial form of the application never displayed and the dialog above appeared with little delay after attempting to start the program.

The program uses an SQL Server Compact Edition 3.5 database and the program is compiled to include the following .DLL files so the user does not need to install SQL ServerCE.
sqlceca35.dll
sqlcecompact35.dll
sqlceer35EN.dll
sqlceme35.dll
sqlceoledb35.dll
sqlceqp35.dll
sqlcese35.dll
System.Data.SqlServerCe.dll

The Load event of the initial form causes a DataSet to be filled from the SQL CE DB.

I have the System Informa

How to get message from Windows to actually running application in WPF?

  

I spend around few hours to find something about my issue on Internet. But I have no idea what to write in Google... :/
So I thought maybe it will be better to write here.
  I wrote an application which can save and open it own files. Then I added special registry key and now when I double-click on a file associated with my application, Windows (OS) opens my application and load the file. Most application work like this and thats OK.
But what I want to do?
I want my application to be opened just once. So when I double-click on a file the application will start running and load the first file. But when I double-click on second file (during my application is already running) windows will open second application. And I want to load this second file to already running application. What should I do??

PS - I am writing WPF application in Visual 2010 with .Net4.


What is the best way to develop a multi-page Windows Application (i.e. work like a web app - no pop-

  

Hi,

I have implemented a toolstrip and want to use this as my menu to change current page (just like a web application). I DON'T want extra forms popping up.   

I ask this question as in the past I have always used TAB Control, but now that I'm using the toolstrip I don't require the Tab Buttons themselves. Can I hide these buttons, during runtime. Obviously I only need one tab displayed at a time.

I have looked at using a panel, but that means I can't flick between panels during design stage.

Any suggestions would be really appreciated.

Thanks.

John.

 

 

 


Cannot get user profile service application to work using the guide on harbar.net?

  

Guys,

I'm hoping someone on here can help with this, as I've really been round the houses with this.

Anyway I've attempted to provision the UPS Service App probably 4 times now, each time learning more and more about the common problems.

The last time, I rolled my VM back to just after the installation of SharePoint 2010 binaries, and then ran the PCW and created the farm again from scratch.

I then followed this guide: http://www.harbar.net/articles/sp2010ups.aspx

Everything seemed to work perfectly well, after provisioning UPS I did a couple of iisresets as welll as execadmsvcjobs until I could see the timer job that provisions the FIM services.

These services came up and the following errors were reported in the event log:

 

The first one is lies, I did start the service and verified it was running, anyway for completeness:

"There are no instances of the User Profile Service started on any server in this farm. Ensure that at least one instance is started on an application server in the farm using the Services on Server page in Central Administration."

This one I have seen constantly on my Farm through various builds:

"An exception occurred when trying to issue security token: An error occurred while receiving t

Infopath Browser Enabled Form - Filters dont work inside repeating table

  

Hi

I have been trying to create a Browser Enabled form to be used as a Sales Order form, the form will work in the following way.

It will pull in info from a sharepoint list with Customer Codes, it will pull in info from another sharepoint list with customer contact information which will be filtered based on which customer is selected.

There will then be a repeating table to place the order items.  The repeating table has 8 columns, 6 of which are lookups against 1 sharepoint list (all the columns are in the same list).

The sharepoint lsit data looks something similar to this:

Item Type                 Item Provider                    Product Relation              Product Description                Delivery Team              Cost
Service                     Us                &

Create Work flow application integrating with domain user and asp.net web pages

  

Hi, I am WF 4.0 learner. I want to create a work flow application where there will be a request web form to fill out the information lets say request for Books order. There will be couples of primary approver who can approve or reject that request. If approve by primary approver it goes to seconday or final approver who also can do approve or reject the request. Only after appove by secondary approver the flow will be successfully end.

In this flow, all users from the domain can request. some users will be primary approver and some are secondary approvers. Can we develop this scenario in WF 4.0? Your idea will be most welcomed. Thanks


support and search

Doing heavy (application general) work in background

  

Hi,

I'm looking for general guidance in a specific task I've been struggling with for a while. I'll try to describe the project in a simple manner:

I have a site that, in it's Page_Load function, checks the Application state for a variable holding some information. This information is changed about every 5 minutes or so. However, fetching that information is quite heavy, and makes the page freeze. Therefore I implemented an asynchronous timer, which made the heavy computation run in the background, when the user was already on the page. In that background operation the Application state variable was set, and could then be used in the next Page_Load(and for all other visitors coming to the page). The timer is frequently called, but the heavy computation is only performed every 5 minutes or so. The problem is that if the user enters the page exactly at this 5 minute interval, and tries to navigate on the site when the background operation is currently running, the site freezes until it's done. 

So, the basic question here is, how do you best perform heavy operations that produces a result general for the entire application? I've been thinking of other ways to thread the application, and I've been thinking of a web service (though I have no experience of services). As the information is general, only one user needs

ARR (Application Request Routing) doesn't work in SharePoint 2010 web application?

  

I'm trying to map a sub folder of a SharePoint 2010 web application to an asp.net web application on another server. For example, http://sharepointserver is a SharePoint 2010 web application and http://anotherserver/mapping is a non-sharepoint asp.net web site, and I want user access content of http://anotherserver/mapping via url http://sharepointserver/mapping.

What I did is:

1. I installed ARR 2.0 on Windows Sever 2008 R2 server which is hosting the SharePoint 2010 web application.

2. I enabled the server proxy in ARR module.

3. I defined a rule in SharePoint 2010 web application to catch request match mapping* and rewrite to url http://anotherserver/mapping{R:1}.

I will always get "404 NOT FOUND" error when I trying to access the url http://sharepointserver/mapping.

But if I do the same on a non-sharepoint website on the sharepoint server, it works, and it even works if I try on a SharePoint 2007 web application.

And if I use Redirect instead of Rewrite, it also works.

Anyone can help one this?

 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend