Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic OnPaint error (Read 4060 times)
Francis Garcia
Guest


OnPaint error
Aug 4th, 2006 at 1:54pm
Print Post  
Hi there,

I am trying to use the trial version of PocketPlanner; I've added it to my project on an empty tabcontrol(only setting Dock property to fill).

Everything seemed fine at design time and it loaded at runtime, but, when going to the calendar tab (not displayed at start), I got an unhandled exception (System.NotSupportedException) in mscorlib, initiated by the OnPaint method (calling in turn the MindFusion.Scheduling.Resources.GetObject() method). The message of the exception simply says: "System.Drawing.Bitmap". Some missing embedded ressource maybe...?

I've tried to add it in a brand new project, and this time it worked fine... So I'm wondering if there is some point I'm missing or if there are some known "incompatibility", as I just used the control "as is"...

In case it would be meaningful, I'm using the Windows Mobile 5.0 PocketPC emulator included with Visual Studio 2005. The only references I'm using out of CF2 are for PocketOutlook and SqlCE, keeping in mind I merely dragged the Calendar control onto my form.
  
Back to top
 
IP Logged
 
Francis Garcia
Guest


Re: OnPaint error
Reply #1 - Aug 4th, 2006 at 2:06pm
Print Post  
Just to be accurate: I do get exceptions even in a brand new project using the calendar control, however those are handled internally, thus not preventing the program from running.

Here is what I get from the Output window:

A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll (x2)
A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll (x9)
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: OnPaint error
Reply #2 - Aug 7th, 2006 at 6:50am
Print Post  
The exceptions indeed get raised when reading bitmap images from the assembly resources. According to Microsoft though, it is usual for many exceptions to be raised and internally handled by the Compact Framework. This should not have impact on the application except slight performance hit in the beginning when the images are loaded from the resources.

For more information on this, please refer to:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=237915&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=139171&SiteID=1

Please, let me know whether the exceptions actually break program's execution.

Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint