Bagga Bug Bagga as they would say in Marathi: Bug in the Task:Reminder property when programming Windows Mobile 5

PocketOutlook.Task.ReminderTime Property has a Bug in it, I was trying to write a small application for myself for my Windows Mobile 5.0 ETen M600 Pocket PC. Essentially in the code I was creating a new task and speciying the reminder time for this task.
The frustrating part begins with the documentation for the Task.ReminderTime property.
It says "Gets or sets the number of minutes a reminder occurs before the start of a task. The default for this is the user setting in the Calendar Options dialog box."
So essentially the documentation description is asking one to specify a number, which it inteprets as minutes. However it also says that "Public Property ReminderTime() as DateTime" meaning that one has to provide a DateTime value.
I proceeded to do this, and provided a DateTime value as directly providing only a number doesnt’ work.
I essentially wanted this task to have a reminder of 10 minutes before the time I set as the starttime of this task.
The only way that you can specify the start of a task is via the startdate property which can only be set to a Date, I tried setting it to a Date and Time value and the Time part was discarded immediately. If the startTime cannot be specified on what basis does the documentation say that the reminder time is some number of minutes before the StartTime. Same goes with the DueDate property. So I assume that the reminder time was an absolute DateTime and continued.
The ReminderTime property is weirder,
First I tried to assign a value to ReminderTime (my instance of the Task)by using an expression like this:
ReminderTask.ReminderTime = Now.AddMinutes(2)
I tried this at around 4:37 P.M. and expected that the reminder time to be set to 4:39
What it actually got set to was some random time.
Next I tried assigning a datetime variable to the ReminderTime property this time again, it refused to accept the value contained within the variable and set the time to some random time even though the variable which i was using called "reminder" had the date time value as #06/27/2006 5:00:00 PM#
By this time I was literally tearing my hair out trying to figure out what to do…and was joined by my friend Raj Chaudhuri who was also breaking his head on this problem.
Finally we got around this bug, by setting Task.ReminderTime property to a new Date() within which I provided the year, date, hour, minute and second to values from my variable which finally worked!
Phew………..the amount of time I spent working around this bug was so irritating… but I thought I’d document it so that others might save themselves time if they attempt the same thing.

About sanjayshetty

Sanjay Shetty is currently putting the finishing touches on his book, the Brand Advocacy quick start guide, which covers his framework for building a brand advocacy program. He blogs at
This entry was posted in Windows Mobile. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s