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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

GDI+ exception in FillRectangle under Windows 7

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :.NET Framework
Hi, Since we have migrated our WinForms based application to .Net 4, we'r getting strange "A generic error occurred in GDI+" errors under windows 7 x64, all coming from System.Drawing.Graphics.FillRectangle(Brush brush, Int32 x, Int32 y, Int32 width, Int32 height) method. These errors originate from different controls, third party ones and from OOB winforms controls (like a menu). I have tried searching the web to see whether others faced this problem however what i have found so far is that some state that this is a known bug in .NET framework. I have tried to search msdn and the web to find anything about this "known" bug with no success yet. Does anyone have any information regarding this? Thanks in advance.  

View Complete Post

More Related Resource Links

Cash Drawer - Method Open threw an exception - Windows Service

Hi All, I'm getting the following exception while calling Open method of Cash Drawer object. Method Open threw an exception.  Could not read the device name key's default value, or could not convert the Programmatic ID it holds into a valid Class ID. Code:   class Class1 { CashDrawer _uniCashDrawer1 = null; DeviceInfo cashDrawerDevice1 = null; PosExplorer posExplorer = new Microsoft.PointOfService.PosExplorer();   public void ClaimCashDrawer() { cashDrawerDevice1 = posExplorer.GetDevice("CashDrawer", "testDrawer"); if (cashDrawerDevice1 != null) { _uniCashDrawer1 = posExplorer.CreateInstance(cashDrawerDevice1) as CashDrawer; if (_uniCashDrawer1 != null) { _uniCashDrawer1.StatusUpdateEvent += new StatusUpdateEventHandler(UniCashDrawer1_StatusUpdateEvent); _uniCashDrawer1.Open(); _uniCashDrawer1.Claim(0); _uniCashDrawer1.DeviceEnabled = true; } } } }   Tha above code works fine if you put the code in WindowsApplication in all POS systems. The same is working if you put the code in Windows Service in all other POS systems. The same is not working if you put the code in Windows Service in Aures Galeo POS systems.  Thanks in advance. Ramakrishnan S

'System OutOfMemory Exception' while using rdlc in Windows application

hi Everyone , I am Using Reporting Service (.rdlc) in my Windows application , i am getting Error System OutOfMemory Exception Like "an error occured during local report processing An Unexpected error occured in Report Processing Exception of type 'System OutOfMemory Exception'Was Thrown " what to do Please anyone help me ... Advance Thanks Anilmarnal

A first chance exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll

I've read a bit about this error and maybe I have nothing to worry about.  BUT ... my simple little app gets 7 of these before it even gets to the first Dim statement in the Class Form1!  I found and followed instructions on how to have the Debugger intercept these exceptions but it seems that they are not being intercepted.  I only know that they have happened because of the messages in the Immediate Window.  In the Designer all I have is 5 Labels and 5 TextBoxes.   Any thoughts on how I could get to the cause of these messages? Thanks,  Bob

Weird Exception: Method not found: 'Double System.Windows.Controls.ScrollViewer.get_ContentHorizon

Hi guys I have an XBAP application that uses a Xamdatagrid from Infragistics. I have some filtering on this grid, that rebinds after a filter. The problem is, when a user has scrolled to a certain point and then filters, the rebinding causes the grid to scroll to the beginning position of the grid. Now how I solve this is by getting an instance of the ScrollViewer, I get the ScrollViewer.ContentHorizontalOffset and then I do a ScrollViewer.ScrollToHorizontalOffset after it filters.   Now here comes the problem. For 99% of the users of this xbap app, this will work absolutely fine. Most, if not all of the users run exactly the same machines, XP 64 bit with 8GB RAM. The other 1% get the error: Method not found: 'Double System.Windows.Controls.ScrollViewer.get_ContentHorizontalOffset()'. I cannot reproduce this error on my own box, our dev server or our production server, it is a phantom exception that only pops up on a certain condition. I have even wrapped the "offending" code in a try catch and it still doesn't solve it. If I set the DispatcherUnhandledExceptionArgs Handled to true, it works, but it doesn't feel right. How is this possible? If the method doesn't exist, how can it compile? Why does that method exist for 99% of the other users running the exact same machines? I have googled my fingers raw without any valid results and this issue is frustrat

SQL Compact 3.5 Database Opening on Windows Vista - Unhandled Exception


I have written a Visual Basic 2008 application that utilizes SQL Server Compact Edition 3.5. On my Vista (32-Bit) development machine, I can install this application and have it connect to my SQLCE Database just fine. However, if I deploy the application to any other Vista computer (32-Bit or 64-Bit), I get the following error message when trying to connect to the database.


Unhandled exception has occured in your application.....


Opening a database as read-only requires a temp path to be specififed. [Db name = C:\users\bob\Documents\MyDatabase.sdf ]


The users who are running the application are in the local machine Administrators group. Running the application "As Administrator" does not resolve the issue.


I've used various connection strings suggested in other threads with no luck. The one I'm currently working with is:


Data Source=C:\users\bob\Documents\MyDatabase.sdf;File Mode=Read Only;Temp Path=%TEMP%;


Does anyone have any suggestions?



Weird Exception C015000F in 32bit MFC app on 64 bit windows 7 with SQLCE 3.5 SP2

Exception code: C015000F The activation context being deactivated is not the
most recently activated one.
Fault address: 776F4391 01:00074391 C:\Windows\SysWOW64\ntdll.dll
One of my customers is getting the following error apparently when trying to
update an SQLCE 3.5 SP2 database.
It appears that the correct 32 and 64 bit versions of Sp2 are installed on
his machine.
Unfortunately, on the 64 bit w7 machine I have, the error doesn't occur.
I've tracked this down to possibly being related to this hotfix:
described more fully here:
http://blog.paulbetts.org/index.php/2010/07/20/the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64/Has anyone else run across this. Any obvious reasons SQLCE might throw anexception on one machine but not another? I have a copy of the databasethat was being accessed, but it appears fine.--Anthony WieserWieser Software Ltd

Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

Visual Studio, Windows 7, Web Site, Profile Exception, HELP!



I have a major problem with a website project using visual studio 2005...

I upgraded my PC to windows 7 X64, I installed vs 2005.

I made sure all components/references matched my old Winxp PC.

With all that said...

I make no changes to the project.

My project works fine in production environment.

I publish the unchanged project to my webserver, and I get the following error when accessing the site...

[ArgumentNullException: Value cannot be null.
Parameter name: type]
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +7469318
   System.Web.Profile.ProfileBase.CreateMyInstance(String username, Boolean isAuthenticated) +79
   System.Web.Profile.ProfileBase.Create(String username, Boolean isAuthenticated) +231
   System.Web.HttpContext.get_Profile() +107
   MasterPage.get_Profile() +17
   MasterPage.Page_Load(Object sender, EventArgs e) +563
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141

I re-publish from my xp box, the error goes away.

The problem occurs on any page that trys to access the Profile object.

I have even tried converting site to .net

Windows Service crash - catch exception


A windows service written in C# is intermittently crashing on a server. If I want to log the reason for crash, can I add try catch block in OnStop method?

will onStop  method get initiated on crashing?

protected override void OnStop()

Windows 2003 64 bit - Web App gives "is not a valid Win32 application. (Exception from HRESULT: 0x80


I've got an x86 deployment which is targeted at x86 and works fine on 2003 server 32 bit.

When I install on win 2003 x64, the installer works OK, but I cant get the first web page to display.

I've done a fair bit of googling but not found an answer yet

The error message is:

Server Error in '/MyCompany' Application.

is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:

[BadImageFormatException:  is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)]
   System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean thro

Web Exception while accessing a Web Service from C# Windows application . Please help


Hi ,

I am trying to consume a webservice from windows application for localtime service.

When I try to fetch the results my application fails with an web exception : Please find the below exception details.

System.Net.WebException was unhandled

  Message="The request failed with HTTP status 407: Proxy Authentication Required."



       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)


Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

Serving Silverlight Apps from Windows Mobile

Even if mobile dev is not my every day work, thanks to the .Net Compact Framework, it's still .Net programming.

Here is the scenario:

You come back home, you have a windows mobile phone wifi capable and you want to quickly get access to your phone pictures from your home network.
You just activate the Wifi, run my app and then browse to the provided link from any computer on the network.

Getting Started with Windows SharePoint Services

Of all of the capabilities of SharePoint, I thought I would start with the most basic installation - as a corporate intranet. It is likely that we will need to discuss some of the elements of SharePoint as we go along, so this also gives us the opportunity to review these elements for future reference.

Before going into too much detail, I would like to point out that you can try the core SharePoint framework (known as Windows SharePoint Services or WSS) for free. On Microsoft's Web site you can download a trial version of Virtual PC 2004 (VPC). Using VPC, you can install the Windows 2003 Evaluation Kit and the WSS add-on. This combination will give you 45 days to evaluate the setup.

Building a Searchable Phone Directory with Windows SharePoint Services

I want to continue to build out the intranet site we've started in our previous articles. A standard item in every intranet is a staff/employee list. Most companies implementing Windows SharePoint Services (WSS) are large enough to have a database that contains all employees. We will use the aggregation features of SharePoint to include data from this database into our intranet.

Getting Started with Windows Communication Foundation

Windows Communication Foundation (WCF) provides a unified framework for rapidly building service-oriented applications that makes it easy to build and consume secure, reliable, and transacted Web services. It unifies the capabilities in ASMX, WSE, Remoting, COM+, and MSMQ; therefore developers need to learn only one programming model.


Every self-respected programmer should include exception handling techniques. Sometimes your application will generate an error. Regardless of who was responsible for this error, the programmer or the user, it is up to the first to include the necessary exception handling techniques to keep his/her program from crashing. The .Net environment provides useful techniques for avoiding disastrous errors such as try-catch statements and user-defined exceptions.
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