Ok, I hate answering my own question but in this case I found the problem. The issue was the underlying API. The IAddressCollection
uses a 1
based indexing instead of a 0
based as I would have expected. It didn't provide this information in the API documentation. There is an item
function where I can pull the object this way and so I can handle this with
IAddressCollection adrCol = IMessage.getAddressees();
for(int i = 1; i <= adrCol.count(); i++){
IAddress adr = adrCol.item(i);
// IAddress is the actual interface that I wanted and this works
}
So sorry for the annoyance on this.