Outlook.dll weirdness

kolbe

Active Member
Licensed User
Longtime 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.

System.typeloadexception: an error message cannot be displayed because an optional resource assembly containing it cannot be found at system.reflection.assembly.getype() at b4p.start..ctor() at B4P.start.main()

The non optimized compilation gives the following error.

an error message cannot be displayed because an optional resource assembly cantaining it cannot be found.

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

B4X:
   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.b4x.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?
 

willisgt

Active Member
Licensed User
If the problem is what I think it is, then this should fix it:

B4X:
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
 

willisgt

Active Member
Licensed User
*sheepish grin* I suddenly feel like the little mouse that pulled a thorn from the lion's paw...
 

kolbe

Active Member
Licensed User
Longtime 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.
 
Top