program MapEdRun;

//{$APPTYPE Console}
{$R MapEd.res}
uses Windows
var
 DLL : THandle;
 AppMain : procedure;
begin
// Writeln('Loading library ...');
 DLL := LoadLibrary('MapEd.dll'); // laduj biblioteke
 try
  @AppMain := GetProcAddress(DLL, 'main'); // laduj procedure
  if @AppMain=nil then begin
//   Write('Core not found! Invalid or missing MapEdRun.dll.');
//   Readln;
   MessageBox(0,'Core not found! Invalid or missing MapEdRun.dll','Error',0);
  end else begin
//   Writeln('Starting function...');
//   Writeln('---');
   AppMain;
  end;
 finally
  FreeLibrary(DLL); // wreszcie zwolnij pamiec
 end;
end.
