I'm having a bad few days suffering from a bad winter cold and I suspect my glib reasoning above is not the reason for the problem as I am now doubting my observation about both string names and references being stored in an ImageList. However it does seem that ImageLists, or at least, what is returned from the ImageList.Item(x) method, are treated differently in the IDE and when optimised compiled so I don't really understand what is going on here.
It seems when optimised compiled an ImageList should only contain references, as I previously assumed, so I have no idea why it was trying to pass a string to DrawImage. Perhaps Erel might shed some light on this as it looks like it might be a bug.
You didn't confirm that mapslist was a Basic4ppc ImageList but it seems so.
Was the offending image assigned to the ImageList at design or runtime?
Did this happen with more than one image?
Were there a misture of images in the ImageList assigned at design and runtime?
Is "compilation to desktop " optimised compiled?
You don't have some example code that produces the problem you could post do you?