Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Unhandled Exception (Read 3433 times)
Harpoon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Nov 8th, 2009
Unhandled Exception
Nov 20th, 2009 at 1:19pm
Print Post  
Am receiving the following unhandled exception. 

I do not receive this exception in the VS environment.  Only after installing a build. 

Should this be happening?  Is it a function of the trial version?


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at MindFusion.Scheduling.WinForms.x611e72b5f4a77a88.DrawItem(Painter painter, x73d940c7760044a8 info, Rectangle itemRect, Brush fillBrush)
   at MindFusion.Scheduling.WinForms.xd7edfddff7999992.DrawItem(Painter painter, x73d940c7760044a8 info, Rectangle itemRect, Brush fillBrush)
   at MindFusion.Scheduling.WinForms.x611e72b5f4a77a88.x2d020c867466444d(Painter x22109dac56c96d29, x73d940c7760044a8 x8d3f74e5f925679c, Brush x7a72ea3aa943057c)
   at MindFusion.Scheduling.WinForms.xd7edfddff7999992.Paint(Painter painter, IList`1 items, IList`1 cells, Boolean enableSnapping, x19ec7fda2bd7290d context)
   at MindFusion.Scheduling.WinForms.x7ec67cd03e3d8c98.x51d3a13ecd447601(x19ec7fda2bd7
290d x0f7b23d1c393aed9)
   at MindFusion.Scheduling.WinForms.x11db8fc7f469a2fc.x51d3a13ecd447601(x19ec7fda2bd7
290d x0f7b23d1c393aed9)
   at MindFusion.Scheduling.WinForms.x8fa5883e2abb527a.x51d3a13ecd447601(x19ec7fda2bd7
290d x0f7b23d1c393aed9)
   at MindFusion.Scheduling.WinForms.Calendar.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Unhandled Exception
Reply #1 - Nov 20th, 2009 at 2:17pm
Print Post  
What is the target computer's OS? Could you also provide me with your Calendar settings and if possible a save file of the schedule which causes the exception (feel free to send those to meppy@mindfusion.eu)? Also, are you using custom items and/or custom item viewers?

Regards,
Meppy
  
Back to top
 
IP Logged
 
Harpoon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Nov 8th, 2009
Re: Unhandled Exception
Reply #2 - Nov 20th, 2009 at 11:52pm
Print Post  
Hi Meppy,

To answer your questions:
The error occurs when I attempt to load from a MySQL DB the custom items.  Because of the issues I was having with reading and writing to a MySQL db, I wrote my own save and load routines.

I am using a custom items but not custom viewers. 
Additionally, I have set the custom item prior to loading the DB into _schedule.schedule
       _schedule.InteractiveItemType = GetType(Activity)

 
The target computer is the same as the development computer....The target OS is Vista Home Premium, SP 2.

Here is the code used to load:
Private Sub LoadFromDB()
       _schedule.Schedule.Clear()
       _schedule.BeginInit()

       Dim myItemCollection As MindFusion.Scheduling.ItemCollection = ScheduleDB.GetAllActivities

       For Each eachItem As MindFusion.Scheduling.Item In myItemCollection
           _schedule.Schedule.Items.Add(eachItem)
       Next
       _schedule.EndInit()

       _schedule.Invalidate()

    End Sub

' Here is the ScheduleDB.GetAllActivities code....note, I have also tried using the class Appointment instead of my custom item Activity with the same error result
Public Shared Function GetAllActivities() As MindFusion.Scheduling.ItemCollection
       Dim allActivities As New MindFusion.Scheduling.ItemCollection

       Using conndb As MySqlConnection = GetDBConnection()
           Dim cmdActivities As New MySqlCommand
           cmdActivities.Connection = conndb
           cmdActivities.CommandText = "SELECT * FROM activities"
           conndb.Open()
           Using rdrActivities As MySqlDataReader = cmdActivities.ExecuteReader
               Do While rdrActivities.Read
                   Dim a As New Activity
                   a.ActivityID = rdrActivities.GetInt64(oActivities.ActivityID)
                   a.ActivityTypeID = rdrActivities.GetInt64(oActivities.ActivityTypeID)
                   a.StartTime = rdrActivities.GetMySqlDateTime(oActivities.StartTime)
                   a.EndTime = rdrActivities.GetMySqlDateTime(oActivities.EndTime)
                   a.Priority = rdrActivities.GetInt64(oActivities.PriorityID)
                   a.EquipmentID = rdrActivities.GetInt64(oActivities.EquipmentID)
                   a.EmployeeID = rdrActivities.GetInt64(oActivities.EmployeeID)
                   a.Timeless = rdrActivities.GetBoolean(oActivities.Timeless)
                   a.Tag = rdrActivities.GetString(oActivities.Tag)
                   a.ContactID = rdrActivities.GetInt64(oActivities.ContactID)
                   a.DescriptionText = rdrActivities.GetString(oActivities.Description)
                   a.HeaderText = rdrActivities.GetString(oActivities.Header)
                   If rdrActivities.GetBoolean(oActivities.Reminder) Then
                       a.Reminder = New MindFusion.Scheduling.Reminder
                       a.Reminder.Message = rdrActivities.GetString(oActivities.ReminderMessage)
                       ' extract the time interval
                       Dim sTimeInterval() As String = Split(rdrActivities.GetString(oActivities.ReminderTimeBefore), ":")
                       Dim iDays As Integer = CInt(sTimeInterval(0))
                       Dim iHours As Integer = CInt(sTimeInterval(1))
                       Dim iMinutes As Integer = CInt(sTimeInterval(2))
                       a.Reminder.TimeInterval = New TimeSpan(iDays, iHours, iMinutes, 0)
                   Else
                       a.Reminder = Nothing
                   End If

                   a.Style = Styles.SetItemStyle(a)

                   allActivities.Add(a)
                   a = Nothing
               Loop

               rdrActivities.Close()
               conndb.Close()
           End Using ' rdrActivities
       End Using ' connDB

       Return allActivities

    End Function
-------------------------------------------------------
  
Back to top
 
IP Logged
 
Harpoon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Nov 8th, 2009
Re: Unhandled Exception
Reply #3 - Nov 20th, 2009 at 11:57pm
Print Post  
Meppy wrote on Nov 20th, 2009 at 2:17pm:
What is the target computer's OS? Could you also provide me with your Calendar settings and if possible a save file of the schedule which causes the exception (feel free to send those to meppy@mindfusion.eu)? Also, are you using custom items and/or custom item viewers?

Regards,
Meppy

Here are the settings for the schedule in question.

       Me._schedule.AllowInplaceCreate = False
       Me._schedule.AllowInplaceEdit = False
       Me._schedule.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                   Or System.Windows.Forms.AnchorStyles.Left) _
                   Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
       Me._schedule.ControlAppearance = MindFusion.Scheduling.WinForms.ControlAppearance.Custom
       Me._schedule.CurrentView = MindFusion.Scheduling.WinForms.CalendarView.Timetable
       Me._schedule.CustomDraw = MindFusion.Scheduling.WinForms.CustomDrawElements.TimetableColumnHeader
       Me._schedule.Date = New Date(2009, 11, 8, 0, 0, 0, 0)
       Me._schedule.DateTimeFormat = CType(resources.GetObject("_schedule.DateTimeFormat"), System.Globalization.DateTimeFormatInfo)
       Me._schedule.DelayInplaceEdit = False
       Me._schedule.EnableKeyboard = False
       Me._schedule.EnableOptimization = True
       Me._schedule.EndDate = New Date(2009, 12, 8, 0, 0, 0, 0)
       Me._schedule.ItemSettings.HeaderSize = 30
       Me._schedule.ItemSettings.PointedItemStyle = CType(resources.GetObject("_schedule.ItemSettings.PointedItemStyle"), MindFusion.Scheduling.Style)
       Me._schedule.ItemSettings.PointedSelectedItemStyle = CType(resources.GetObject("_schedule.ItemSettings.PointedSelectedItemStyle"), MindFusion.Scheduling.Style)
       Me._schedule.ItemSettings.SelectedItemStyle = CType(resources.GetObject("_schedule.ItemSettings.SelectedItemStyle"), MindFusion.Scheduling.Style)
       Me._schedule.ItemSettings.Style = CType(resources.GetObject("_schedule.ItemSettings.Style"), MindFusion.Scheduling.Style)
       Me._schedule.Location = New System.Drawing.Point(78, 0)
       Me._schedule.Name = "_schedule"
       Me._schedule.Selection.AllowMultiple = MindFusion.Scheduling.WinForms.State.Disabled
       Me._schedule.Selection.SelectedElementsStyle = CType(resources.GetObject("_schedule.Selection.SelectedElementsStyle"), MindFusion.Scheduling.Style)
       Me._schedule.ShowToolTips = True
       Me._schedule.Size = New System.Drawing.Size(808, 580)
       Me._schedule.TabIndex = 1
       Me._schedule.Theme = MindFusion.Scheduling.WinForms.ThemeType.Silver
       Me._schedule.TimetableSettings.ColumnBandSize = 8
       Me._schedule.TimetableSettings.DayHeaderMinSize = 20
       Me._schedule.TimetableSettings.EndTime = 1080
       Me._schedule.TimetableSettings.HeaderDateFormat = "ddd - MMM dd, yyyy"
       Me._schedule.TimetableSettings.InfoHeaderSize = 20
       Me._schedule.TimetableSettings.MainHeaderSize = 30
       Me._schedule.TimetableSettings.ShowCurrentTime = MindFusion.Scheduling.WinForms.State.Enabled
       Me._schedule.TimetableSettings.ShowDayHeader = MindFusion.Scheduling.WinForms.State.Enabled
       Me._schedule.TimetableSettings.ShowInfoHeader = MindFusion.Scheduling.WinForms.State.Disabled
       Me._schedule.TimetableSettings.ShowItemSpans = MindFusion.Scheduling.WinForms.State.Enabled
       Me._schedule.TimetableSettings.ShowMinutesInHourHeaders = MindFusion.Scheduling.WinForms.State.Enabled
       Me._schedule.TimetableSettings.ShowNavigationButtons = MindFusion.Scheduling.WinForms.State.Enabled
       Me._schedule.TimetableSettings.ShowPadding = MindFusion.Scheduling.WinForms.State.Disabled
       Me._schedule.TimetableSettings.StartTime = 420
       Me._schedule.TimetableSettings.Style = CType(resources.GetObject("_schedule.TimetableSettings.Style"), MindFusion.Scheduling.Style)
       Me._schedule.TimetableSettings.TimelineStyle = CType(resources.GetObject("_schedule.TimetableSettings.TimelineStyle"), MindFusion.Scheduling.Style)
       Me._schedule.TimetableSettings.VisibleColumns = 1
       '

Plus, I am modifying the setttings as follows:
   Private Sub SetupSchedule(ByVal startDate As Date)
       _schedule.BeginInit()
       _schedule.TimetableSettings.Dates.Clear()

       Dim i As Integer
       For i = 0 To My.Settings.Calendar_NumberofDaysToView - 1

           _schedule.TimetableSettings.Dates.Add(startDate.Add(New TimeSpan(i, 0, 0, 0)))

       Next i
       _schedule.TimetableSettings.VisibleColumns = My.Settings.Calendar_NumberofDaysToView
       _schedule.EndInit()

    End Sub
  
Back to top
 
IP Logged
 
Harpoon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Nov 8th, 2009
Re: Unhandled Exception
Reply #4 - Nov 21st, 2009 at 3:27am
Print Post  
Ok Meppy, I found a fix. 

The target CPU is 64-bits so I was compiling the application with the target CPU being "Any CPU."  If I compile with the target CPU as x86 and not as Any CPU, then everything works okay...no unhandled exception. 

Still, isn't Planner.Net compatible with 64-bit CPUs?

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