OLEDropFile example for Delphi
This example displays the name of the file that was dropped, and then loads it.
procedure TForm1.LEADRasterView1OleDropFile(Sender: TObject;
const pszName: WideString);
var
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO)as LEADRasterIO;
//when a file is dropped, bring up a dialog box and ask the user
//whether to load the file or not
if (MessageBox (Handle, PChar(pszName), '', MB_YESNO) = IDYES) then
RasterIO.Load (LEADRasterView1.Raster, pszName, 0, 1, 1)
else
ShowMessage ('File Not Loaded!');
end;