Hello,
 
Ihave got a trouble developing integrated Mapping using Delphi. I use only one map window and one browser window in Delphi. Every time i call a table/map, the map/table viewed in map window and when i browse the table, the table viewed in browser window. The trouble happen when i call another table, the table not viewed anywhere(the previous table still opened and viewed), it happen to the browser window too.Any one know what is the problem?How to reuse the map window.
 
Here is a few procedure from my program listing...
 
procedure TMainForm.FormActivate(Sender: TObject);
begin
  MIMap := CreateOleObject('MapInfo.Application');
  legendid:=0;
  MIMap.DO('Set Application Window ' + IntToStr(MainForm.Handle));
  mimap.do('Set Window Help Off');
  mimap.do('Set Window Info Parent '+inttostr(MapWin.Handle));
  mimap.do('Set Window Info ReadOnly');
  mimap.do('Set Window Ruler Parent '+inttostr(MapWin.Handle));
  MIMap.DO('Set Next Document Parent ' + IntToStr(MapWin.handle) + ' Style 1');
  MIMap.do('Run Application "'+'ST3.wor'+'"');
  Val(mimap.eval('WindowID(0)'),mapid,code);
end;
procedure TMainForm.cariip;
var i,code:integer;
swinhand:string;
begin
  MIMap.do('Find Using ServerL2(IP)');
  MIMap.do('Find "'+cariipform.cariip.Text+'"');
  Val(mimap.eval('CommandInfo(3)'),i,code);
If i >= 1 Then
 begin
 mimap.do('Set Map Window "'+inttostr(mapid)+'" Center(CommandInfo(1), CommandInfo(2))');
 MIMap.do('Select * from serverL2 where IP = "'+cariipform.cariip.Text+'"');
 cariipform.jenisteks.Caption:='Jenis Komputer : Server';
 cariipform.ruangteks.Caption:='Ruang : '+mimap.eval('serverL2.lokasi');
 cariipform.systemteks.Caption:='System : '+mimap.eval('serverL2.os');
 Str(BrowserWin.Handle, sWinHand);
 mimap.do('Set Next Document Parent ' + sWinHand + ' Style 1');
 mimap.do('Browse * from Selection');
 end
else
begin
  MIMap.do('Find Using clientL2(IP)');
  MIMap.do('Find "'+cariipform.cariip.Text+'"');
  Val(mimap.eval('CommandInfo(3)'),i,code);
If i >= 1 Then
 begin
 mimap.do('Set Map Window "'+inttostr(mapid)+'" Center(CommandInfo(1), CommandInfo(2))');
 MIMap.do('Select * from clientL2 where IP = "'+cariipform.cariip.Text+'"');
 cariipform.jenisteks.Caption:='Jenis Komputer : Client';
 cariipform.ruangteks.Caption:='Ruang : '+mimap.eval('clientl2.lokasi');
 cariipform.systemteks.Caption:='System : '+mimap.eval('clientL2.os');
 Str(BrowserWin.Handle, sWinHand);
 mimap.do('Set Next Document Parent ' + sWinHand + ' Style 1');
 mimap.do('Browse * from Selection');
 end
else
begin
 cariipform.ruangteks.Caption:='Komputer belum terpasang';
 cariipform.systemteks.Caption:='';
 cariipform.jenisteks.Caption:='';
end;
end;
end;
 
 
Oke, that all.Thank's

Reply via email to