Outlook.dll weirdness

Discussion in 'Questions (Windows Mobile)' started by kolbe, May 28, 2008.

  1. kolbe

    kolbe Active Member Licensed User

    Hello all,

    I'm writing a simple app for the device that will let you save and restore all your contacts and calendar events. I'm using wm5 and netcf 2 and basic4ppc v6.3.

    I've encountered several problems I can't seem to figure out. It is related to my use of outlook.dll.

    The optimized force qvga compilation gives the following error at runtime.

    The non optimized compilation gives the following error.

    The regular optimized compilation will run but then gives me the later of the two errors from time to time in the following code.

    Code:
    For i = 0 To PCol_contacts.Count-1
          PCol_contacts.RemoveItem(i)
          label1.Text=
    "Contact "&i&" removed"
       
    Next
       
    Msgbox("Removed all Contacts")
    If I have 400 contacts it will produce an error after deleting 200, if I press yes to continue, then the error pops up after deleting 100, then at 50, then at 25, and so on. Very strange.

    I encountered the following problem http://www.basic4ppc.com/forum/questions-help-needed/2297-problem-contacts.html#post12428 but I don't think it's related because for now I'm just ignoring the webpage field.

    Any ideas?
     
  2. willisgt

    willisgt Active Member Licensed User

    If the problem is what I think it is, then this should fix it:

    Code:
    For i = PCol_contacts.Count-1 to 0 Step -1
          PCol_contacts.RemoveItem(i)
          label1.Text=
    "Contact "&i&" removed"
       
    Next
    Please let me know if this fixes the problem.


    Gary
     
  3. agraham

    agraham Expert Licensed User

    Thanks for the nudge Gary. I see "what you think it is" and it explains an entirely different iteration problem I had a few months ago that I could not explain at the time. I missed the obvious in not trying a reverse iteration I guess :)
     
  4. willisgt

    willisgt Active Member Licensed User

    *sheepish grin* I suddenly feel like the little mouse that pulled a thorn from the lion's paw...
     
  5. kolbe

    kolbe Active Member Licensed User

    Thank you Gary and agraham.

    Reversing the iteration did solve one problem. So what is the theory here? Why an error after deleting half the contacts? Data structure bug?

    The other problems turned out to be kinda silly. The QGVA compilation didn't work because I named the project outlook. When you compile in this mode it makes a dll named after the project name. This overwrites the original outlook.dll! I'll report this little bug.

    For the non optimized compilation I just didn't include all the dlls. :signOops:

    Thanks again.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    After removing contact number 0, contact number 1 becomes 0, contact 2 becomes contact 1... contact n becomes contact n-1.
    This code will also work:
    Code:
    For i = 0 To PCol_contacts.Count-1
          PCol_contacts.RemoveItem([B]
    0[/B])
          label1.Text=
    "Contact "&i&" removed"
       
    Next
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice