
Islamic Diary is now available as an OLE Automation server. This means that if you want you can embed its functionality in your own application.
You must be familiar with at least one 4GL programing language that can use COM components, for example Visual Basic. Click Here to download a sample project. This project is written in Visual Basic 5.0 and includes the required DLLs.
You need two DLLs for development:
Important: Make sure that both these DLLs are in the same directory or in the system path. Click Here to download the DLLs and sample project.
Registration
Since XDIARY.DLL is a COM object, you must register it with the
system. Type the following line at the comand prompt to register.
c:\islamic> regsvr32 xdiary.dll
The above line assumes that regsvr32.exe is somewhere in the system path.
Using it in Visual Basic
Before making calls to the server, you must include its reference in the project. Go to
Reference... in the Project menu and select "Islamic Diary OLE Automation
Server". If you don't see it in the list, the server is not properly registered.
The API exposes a set of functions that can be called from a client. You can see these function through the object browser in Visual Basic (Press F2 for the browser).
Function XGetSunrise
Function XGetFajar
Function XGetZuhr
Function XGetMaghrib
Returns Value: All these function return a String representing the time for Fajar, Sunrise, Zuhr and Maghrib respectively.
| day | Day of the month |
| month | Month of the year. |
| year | Year value. |
| latitude | Latitude value for the location (North is +) |
| longitude | Longitude value for the location (East is +) |
| timezone | Time zone for the location |
| daylight | Optional. If missing daylight savings OFF is assumed. 0 means OFF and 1 means ON. |
Function XGetSunriseMinutes
Function XGetSunsetMinutes
Returns Value: An integer representing the number of minutes since
Midnight to Sunrise and sunset.
Description: You can use this function in conjunction with
XGetSunsetMinutes to calculate other values which are not provided by the API, including
Asr, Zuhr Qada and more.
| day | Day of the month |
| month | Month of the year. |
| year | Year value. |
| latitude | Latitude value for the location (North is +) |
| longitude | Longitude value for the location (East is +) |
| timezone | Time zone for the location |
| daylight | Optional. If missing daylight savings OFF is assumed. 0 means OFF and 1 means ON. |
Function XMisriToGregorian
Function XGregorianToMisri
Return Value: A String representing the converted date
Description: These function take either Hijri or Gregorian date and
converts it to the other
| day | Day of the month |
| month | Month of the year. |
| year | Year value. |
Sub XMisriToGregorianDate
Sub XGregorianToMisriDate
Return Value: None
Description: These functions return there answer through parameters. This
allows you to do mathmatical operations and format the result.
| day | Day of the month |
| month | Month of the year. |
| year | Year value. |
| aDay | Converted day of the month |
| aMonth | Converted Month of the year. |
| aYear | Converted Year value. |