Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Bug Reports
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Bug Reports Post about errors or bugs encountered.


Problems with outlook.dll


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-12-2007, 10:00 AM
Junior Member
 
Join Date: Nov 2007
Location: Ulm, Germany
Posts: 10
Default Problems with outlook.dll

Hi!
(i hope my english is good enough to understand) ;-)

Im writing a tool to import/export contacts as vcards and have some trouble while accessing data:

*************************************
First problem: Contact.WebPage

setting Contact.WebPage by program to a nonvalid URL (without leading http://) produced an runtime error - not a real problem: syntaxcheck is possible;-)

BUT:

If Contact.Webpage contains an non valid URL (entering or editing the contact manually by user) then accessing to this field produces an runtime error!

How to access or syntaxcheck this field if every access fails?


***********************************************
Second problem: Contact.Birthday and Contact.Anniversary

If the user has no date(s) in an contact entry the query

strDate = Date(Contact.Birthday) delivers the date: 01/01/1601

in this case the reverse operation:

Contact.Birthday = ParseDate(strDate)

generates an runtime error to!

If birthdday or anniversary set to an actual date -> No problem


************************************************** ****
my sample code for the second problem (in case its an human problem):
************************************************** ****

Sub Globals
'Declare the global variables here.
End Sub

Sub App_Start
ErrorLabel(errHandler)
Form1.Show
Contact.New1
PimCol.New1("Contacts")
nr = PimCol.FindItem("LastName","Tester")
If nr > -1 Then
Contact.Value = PimCol.GetItem(nr)

ContactDateTicks=Contact.Birthday
ContactDateString=Date(Contact.Birthday)

'reverse operation
ContactDateNewTicks=DateParse(ContactDateString)

'for showing query results only
Label1.Text = ContactDateTicks &crlf
Label1.Text = Label1.Text & ContactDateString &crlf
Label1.Text = Label1.Text & ContactDateNewTicks &crlf

'following line now fails if Contact entry is not set to a ?valid? date
Contact.Birthday = ContactDateNewTicks
Contact.Update
Else
Label1.Text = "Create a contact with Lastname: Tester first!"
End If
Label1.Text = Label1.Text & "SUCCESS!"
Form1.Refresh
Sleep(3000)
AppClose

errHandler:
Label1.Text = Label1.Text & "FAIL!"
Form1.Refresh
Sleep(4000)
AppClose
End Sub

Last edited by Gerd : 12-12-2007 at 10:02 AM.
Reply With Quote
  #2 (permalink)  
Old 12-12-2007, 01:47 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,845
Default

1) You will need to use ErrorLabel to handle invalid URL pages.
2) I don't see this behavior when I run similar code.
What happens if you do: Msgbox(DateParse("01/01/1601")) ?
Reply With Quote
  #3 (permalink)  
Old 12-13-2007, 03:02 PM
Junior Member
 
Join Date: Nov 2007
Location: Ulm, Germany
Posts: 10
Arrow

Now i know a little bit more...

Quote:
Originally Posted by Erel View Post
1)

2) I don't see this behavior when I run similar code.
What happens if you do: Msgbox(DateParse("01/01/1601")) ?
I see: 504911232 000000000

at least two hours i tried some code to create a new or update an existing contact with an birthday entry :

This date/code really fails:
Contact.Birthday = DateParse("01/01/1601")

And this really works:
Contact.Birthday = DateParse("01/01/1901")

BUT!!!

The error accours not at putting the data into Contact.Birthday! The errors occours at:
Contact.update or PimCol.AddItem(Contact.Value)


+++++++++++++++++++++++++++++++++++
Code sample - in any case msgbox() will be showed with the ticks.
After closing the MsgBox the Message "Fail" will be displayed (or not)
+++++++++++++++++++++++++++++++++++

Sub App_Start
ErrorLabel(errHandler)
Form1.Show
Contact.New1
PimCol.New1("Contacts")
Contact.CreateNew
Contact.LastName="Tester"
' Contact.Birthday = DateParse("01/01/1901") ' with this line it works
Contact.Birthday = DateParse("01/01/1601") ' with this line it fails
Msgbox(Contact.Birthday)

PimCol.AddItem(Contact.Value)
Sleep(3000)
AppClose

errHandler:
Label1.Text = "FAIL!"
Form1.Refresh
Sleep(4000)
AppClose
End Sub


+++++++++++++++
Reply With Quote
  #4 (permalink)  
Old 12-13-2007, 03:35 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,368
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

According to Microsoft Embedded developer Centre Pocket Outlook model
Quote:
Maximum/Minimum Dates for Calendar Entries

These constants define the maximum and minimum date values for Calendar entries.

Constant Value Description
CAL_MAXDATE (DATE) 401768 12/31/2999
CAL_MINDATE (DATE) 0 12/30/1899
DATE_NONE (DATE) 949998 1/1/4501
Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later
Could it be because "01/01/1601" is out of range?
Reply With Quote
  #5 (permalink)  
Old 12-13-2007, 05:26 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,845
Default

I think that agraham is right (as usual) about the valid range of dates.
Reply With Quote
  #6 (permalink)  
Old 12-14-2007, 12:35 PM
Junior Member
 
Join Date: Nov 2007
Location: Ulm, Germany
Posts: 10
Default

Quote:
Originally Posted by Erel View Post
I think that agraham is right (as usual) about the valid range of dates.
I agree!

Manualy entering a date less then 1900 will be automatically corrected!

Now i know that something goes wrong inside outlook.dll/Win Mobile 6/my Smartphone, that it is generating an non valid date while reading an empty entry ...

So I have wrote a small hack around...

Thanks to all and i wish you a happy new year!

Gerd
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sprite problems willisgt Questions & Help Needed 2 02-28-2008 05:30 PM
Form problems Lasse Questions & Help Needed 11 10-09-2007 11:46 AM
FTP Library Problems Louis Questions & Help Needed 1 06-19-2007 09:33 AM
Table Sort Problems RandomCoder Questions & Help Needed 21 05-22-2007 08:43 PM
OpenNet problems Lasse Questions & Help Needed 7 05-20-2007 07:17 PM


All times are GMT. The time now is 07:39 AM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0