Open Dental in Windows 10 with Persian Calendar

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
nwdentist
Posts: 20
Joined: Wed Jun 25, 2014 11:08 pm

Open Dental in Windows 10 with Persian Calendar

Post by nwdentist » Sat Jan 31, 2015 9:44 am

As you may know, Microsoft is giving people a chance to test drive the unreleased Windows 10 builds, and after a vote on the user voice website, starting with build 9926 (January 2015), Windows has finally a Persian Calendar, selectable from regional settings.

So I got a chance to test Open Dental trial (version 14.1.18.0) with the new Windows 10 Pro Technical Preview (Evaluation copy Build 9926) during the weekend and it seems Open Dental installs and runs smoothly under Windows 10 (I could not get DirectX to work though).

However, with dates set to Persian Calendar, unhandled exception occurs when you try to start Open Dental. Here are the details of the error:

Code: Select all

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

************** Exception Text **************
System.ArgumentOutOfRangeException: Specified time is not supported in this calendar. It should be between 03/21/0622 00:00:00 (Gregorian date) and 12/31/9999 23:59:59 (Gregorian date), inclusive.
Parameter name: time
   at System.Globalization.PersianCalendar.CheckTicksRange(Int64 ticks)
   at System.Globalization.PersianCalendar.GetDatePart(Int64 ticks, Int32 part)
   at System.Globalization.PersianCalendar.GetMonth(DateTime time)
   at System.DateTimeFormat.FormatCustomized(DateTime dateTime, String format, DateTimeFormatInfo dtfi, TimeSpan offset)
   at System.DateTimeFormat.Format(DateTime dateTime, String format, DateTimeFormatInfo dtfi, TimeSpan offset)
   at System.DateTimeFormat.Format(DateTime dateTime, String format, DateTimeFormatInfo dtfi)
   at System.DateTime.ToString()
   at OpenDentBusiness.Crud.GroupPermissionCrud.TableToList(DataTable table)
   at OpenDentBusiness.GroupPermissions.FillCache(DataTable table)
   at OpenDentBusiness.GroupPermissions.RefreshCache()
   at OpenDentBusiness.GroupPermissionC.get_List()
   at OpenDentBusiness.Userods.GetAdminUser()
   at OpenDental.FormOpenDental.FormOpenDental_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(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)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
OpenDental
    Assembly Version: 14.1.18.0
    Win32 Version: 14.1.18.0
    CodeBase: file:///C:/Program%20Files/Open%20Dental/OpenDental.exe
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
CodeBase
    Assembly Version: 7.1.0.0
    Win32 Version: 7.1.0.0
    CodeBase: file:///C:/Program%20Files/Open%20Dental/CodeBase.DLL
----------------------------------------
OpenDentBusiness
    Assembly Version: 14.1.18.0
    Win32 Version: 14.1.18.0
    CodeBase: file:///C:/Program%20Files/Open%20Dental/OpenDentBusiness.DLL
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
NHunspell
    Assembly Version: 0.9.6.0
    Win32 Version: 0.9.6.0
    CodeBase: file:///C:/Program%20Files/Open%20Dental/NHunspell.DLL
----------------------------------------
SparksToothChart
    Assembly Version: 4.7.1.0
    Win32 Version: 4.7.1.0
    CodeBase: file:///C:/Program%20Files/Open%20Dental/SparksToothChart.DLL
----------------------------------------
Microsoft.DirectX.Direct3D
    Assembly Version: 1.0.2902.0
    Win32 Version: 9.05.132.0000
    CodeBase: file:///C:/Program%20Files/Open%20Dental/Microsoft.DirectX.Direct3D.DLL
----------------------------------------
xImageDeviceManager
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/Open%20Dental/xImageDeviceManager.DLL
----------------------------------------
SigPlusNET
    Assembly Version: 1.1.4050.24928
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/Open%20Dental/SigPlusNET.DLL
----------------------------------------
msvcm90
    Assembly Version: 9.0.30729.9132
    Win32 Version: 9.00.30729.9132
    CodeBase: file:///C:/Windows/WinSxS/x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9132_none_50903d3abcbab068/msvcm90.dll
----------------------------------------
System.Web.Services
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Web.Services/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
----------------------------------------
OpenDental.XmlSerializers
    Assembly Version: 14.1.18.0
    Win32 Version: 14.1.18.0
    CodeBase: file:///C:/Program%20Files/Open%20Dental/OpenDental.XmlSerializers.DLL
----------------------------------------
AxInterop.AcroPDFLib
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/Open%20Dental/AxInterop.AcroPDFLib.DLL
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
CDT
    Assembly Version: 12.3.20.0
    Win32 Version: 12.3.20.0
    CodeBase: file:///C:/Program%20Files/Open%20Dental/CDT.DLL
----------------------------------------
MySql.Data
    Assembly Version: 6.2.4.0
    Win32 Version: 6.2.4.0
    CodeBase: file:///C:/Program%20Files/Open%20Dental/MySql.Data.DLL
----------------------------------------
System.Transactions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
Oracle.DataAccess
    Assembly Version: 2.112.2.0
    Win32 Version: 2.112.2.0
    CodeBase: file:///C:/Program%20Files/Open%20Dental/Oracle.DataAccess.DLL
----------------------------------------
System.EnterpriseServices
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.5.27.0 built by: FX453PREVIEWREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
Ionic.Zip
    Assembly Version: 1.9.1.4
    Win32 Version: 1.9.1.4
    CodeBase: file:///C:/Program%20Files/Open%20Dental/Ionic.Zip.DLL
----------------------------------------
Tao.OpenGl
    Assembly Version: 2.1.0.4
    Win32 Version: 2.1.0.4
    CodeBase: file:///C:/Program%20Files/Open%20Dental/Tao.OpenGl.DLL
----------------------------------------
Tao.Platform.Windows
    Assembly Version: 1.0.0.4
    Win32 Version: 1.0.0.4
    CodeBase: file:///C:/Program%20Files/Open%20Dental/Tao.Platform.Windows.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Persian calendar uses a different start time (year zero) ---"03/21/0622 00:00:00 (Gregorian date)"--- as reported in the error. This is also true of Hijri calendar.

I test with Hijri calendar (which is selectable under regional settings with Arabic language) and it works. The date fields like birth date, first visit, and so on show the Hijri dates (and make use of it to calculate "age") just fine.

If I hit ignore I get a screen with module icons on the left and a blank space on the right.

However, if you set the calendar back to Gregorian, OD will start. Then you can change back to Persian Calendar again while OD is running and the calendar shows up on the appointments module. Although you cannot use it on "date" fields and timestamps (they still take the Gregorian dates).

So I wonder why OD works fine with Hijri dates but not with Persian calendar.

Anyone with an idea how to fix this?
Sina

jwhitney
Posts: 33
Joined: Tue Jul 01, 2014 9:52 am

Re: Open Dental in Windows 10 with Persian Calendar

Post by jwhitney » Tue Feb 03, 2015 7:28 am

There are 2 potential reasons for this.
1. Since Windows 10 is still in the process of being made, that means support for Windows 10 for .NET is still being worked on, and as such things will be stamped as "not supported" throughout the .NET framework that is installed on your machine (https://msdn.microsoft.com/en-us/librar ... .110).aspx); and/or
2. "Your application should not use a PersianCalendar object as the default calendar for a culture. The default calendar is specified by the CultureInfo.Calendar property and must be one of the calendars returned by the CultureInfo.OptionalCalendars property. Currently, the PersianCalendar class is not an optional calendar for any culture supported by the CultureInfo class and consequently cannot be a default calendar." via (https://msdn.microsoft.com/en-us/librar ... .110).aspx). I haven't researched the locale preference emulation but I would think this could be a potential issue.

As far as I know, the Region & Language option of Persian has been an option for a while now, and the calendar that is corresponding to it works in Open Dental, so unless I am mistaken by what you mean by calendar in Region & Language, it's probably reason #1, that Windows 10 isn't a full release yet and will undoubtedly not be supported by .NET until then.
In order to understand recursion you must first understand recursion.

Josh Whitney
Open Dental Software
1-503-363-5432
http://www.opendental.com

nwdentist
Posts: 20
Joined: Wed Jun 25, 2014 11:08 pm

Re: Open Dental in Windows 10 with Persian Calendar

Post by nwdentist » Wed Feb 04, 2015 2:21 am

Thank you Josh for getting involved.
jwhitney wrote:As far as I know, the Region & Language option of Persian has been an option for a while now, and the calendar that is corresponding to it works in Open Dental, so unless I am mistaken by what you mean by calendar in Region & Language, it's probably reason #1, that Windows 10 isn't a full release yet and will undoubtedly not be supported by .NET until then.
Well, the calendar in Windows that is corresponding to Persian (before Windows 10 build 9926) is actually the Gregorian calendar with transliterated month names in Persian. So it is basically no different calendar than that used with English (United States) and should work with Open Dental. The major issue, however, is that using this calendar is not at all practical in Iran, since the official calendar in daily use is the Persian (Jalali) calendar (the one that is recently added to Windows 10 9926 Persian interface).

Your points are well taken. Searching the web, you could see there have been attempts as a workaround to make PersianCalendar usable for an application. An example: http://www.codeproject.com/Articles/256 ... sian-Cutur.

Hijri calendar (used mostly in Arabic speaking countries, and also in Iran for religious dates) is supported better by .NET; however, a simple test with OD gave inconsistent results. Comparing the trial available at http://opendental.com/TrialDownload-14-1-18.exe under Windows 7 and Windows 10 9926, you get date range exceptions for Hijri calendar in Windows 7 but no error in Windows 10. Hijri seems to be fully running in OD under Windows 10. You see the dates in the corresponding fields and timestamps in Hijri. Change back to Gregorian calendar, start Open Dental again, and you'll see all the stored dates in Gregorian. Get it back to Hijri and restart OD, and you'll have dates again in Hijri.

This is a great functionality for OD---exactly the way anybody would expect it to work. I wonder what is different between the two environments that causes the same software to work smoothly in one, and give errors in the other.

That would be awesome if it worked the same way in Windows 10 for Persian too.
Sina

nwdentist
Posts: 20
Joined: Wed Jun 25, 2014 11:08 pm

Re: Open Dental in Windows 10 with Persian Calendar

Post by nwdentist » Wed Feb 04, 2015 6:53 am

OK. I got part of the answer. The .NET framework on the test Windows 7 machine was .NET 4.5 and on the test Windows 10 machine it was .NET 4.6 Preview. So something must have changed in between the versions (as there are other versions like 4.5.1 or 4.5.2) that could explain the improvement.

Now as for the ability of Persian to be set as default calendar in .NET I guess we just have to keep fingers crossed! Or ask on the .NET user voice website! Maybe they listen this time.
Sina

Post Reply