I'm writing a CS .net wrapper to be used in a Delphi application and I would like to load images from the "remote" .net lib so I don't need to maintain a "copy" imagelist in Delphi.
Question how do I fetch the imagelist via a TLB?
I think I have 3 options to implement this
- on startup of application, fetch imagelist by ref and copy to a local imagelist. This gives me an IUnknown as ref parameter in the TLB, can I use that somehow?
- I could use a string/widestring or maybe a stream of some sort, I think that could/would be marshalled as a delphi type.
- I could store the imagelist as bitmap and load that in delphi on startup - but who would fancy to do that :)
Any ideas / suggestions a more than welcome.
This is the wrapper method
public bool LoadImageList(ref ImageList imagelist16, ref ImageList imagelist32, ref String ResMsg)
{
ResMsg = "Imagelist could be loaded: ";
try {
imagelist16 = null;
imagelist32 = null;
if (!_initialized) return false;
imagelist16 = VideoOS.Platform.UI.Util.ImageList;
imagelist32 = VideoOS.Platform.UI.Util.ImageList32;
ResMsg = "Images loaded";
return true;
}
catch (Exception e) {
ResMsg = ResMsg + e.Message;
return false;
}
}
This is the Delphi TLB unit
function LoadImageList(var imagelist16: IUnknown; var imagelist32: IUnknown;
var ResMsg: WideString; out pRetVal: WordBool): HResult; stdcall;