You don't say what types are involved and poking round in your dll I can't see anything with a NumItems property and can't directly map that sample fragment onto your code. My best guess is that you want to replace the four LoadXxxMsg methods with one and specify things like "OutboxFolder" as a String.
The easiest thing is probably to do a switch to set an instance of IMAPIFolder to the required folder and then do the common stuff on that. Treat this as psuedo code - there are probably mistakes as I've just dashed it off and there is no error checking for a bad string value.
B4X:
public void LoadMsg(string folder)
{
folder = folder.ToLower()
IMAPIFolder f;
switch (s)
{
....
case "outbox":
f = stores[StoreNum].OutboxFolder; break;
....
}
this.MsgNum2 = (int) stores[this.StoreNum].OutboxFolder.NumSubItems;
int num = 0;
int numSubItems = (int) f.NumSubItems;
while (num < numSubItems)
{
msg = f.GetNextMessages(MsgNum2);
num++;
}
}
Sorry AGraham, my example was psudo code :-( Oops.
I never intended anyone to spend time on it. Or this post.
Happy New Year mate, hope it's good for you
I considered using Case etc. I'd still need 4 seperate Case statements ?
The code in my dll works fine.
I just felt a bit hypocritical of telling other forum users about the
255 Buttonx_Click events when Control and Sender are available.