谁有Mapinfo与Delphi 调用的例程序:)请进,不会吧,200分没人要。只要例程 (200分)

  • 主题发起人 主题发起人 Andisof
  • 开始时间 开始时间
A

Andisof

Unregistered / Unconfirmed
GUEST, unregistred user!
谁有Mapinfo与Delphi 这间调用的例程序,通过OLE调用的
最好全面一些。
 
我用delphi开发关于Maoinfo的程序有一年多了,你的问题可以在Mapbasic的例子中看到,
一般的连接以及调用里面都有例子,如果还想要更详细的,就可我来信吧。我的E-mail:
plf22@yeah.net。[:)]
 
plf22,能否给一个完整的例子,
Andisof@263.net
谢谢。要是能用,我把200分全给你。


 
好的,我马上发给你!^_^
 
好啊
我也要
wangrb@cattsoft.com
 
谢谢eric.youbin,这不是要的这个,你这个是个控件,而我要的是:如
MapInfo : Variant;

MapInfo := CreateOLEObject('Mapinfo.Application');
...
 
我写的例子已经发给你了,希望你满意。
 
plf22,还没有收到,能否重发。谢谢。
 
我把源程序贴上来了,邮件我也又发了,我的服务太周到了。
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls,oleauto, Buttons;

type
TForm1 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
SpeedButton6: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton10: TSpeedButton;
SpeedButton11: TSpeedButton;
SpeedButton8: TSpeedButton;
procedure FormCreate(Sender: TObject);
procedure SpeedButton6Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure SpeedButton5Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton10Click(Sender: TObject);
procedure SpeedButton11Click(Sender: TObject);
procedure SpeedButton8Click(Sender: TObject);
private
function openmap(filename:string):boolean;
{ Private declarations }
public
{ Public declarations }
end;


var
Form1: TForm1;
path:string;
oleMapInfo: Variant;
wmainID:string;
implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin

path:=extractfilepath(application.ExeName);
oleMapInfo := CreateOLEObject('MapInfo.Application');
//连接MAPINFO
olemapinfo.do('Set Application Window ' + inttoStr(Form1.Handle));
olemapinfo.do('Set Window Ruler Parent ' + inttoStr(Form1.panel1.Handle));
openmap(path+'map/建筑层1.tab');
olemapinfo.do('set nextdo
cument parent '+intTostr(panel1.handle)+'Style 1');
olemapinfo.do('map from 建筑层1');
//如果为多层,可定义图层的叠放顺序
wmainID:=olemapinfo.eval('frontwindow()');
olemapinfo.do('set map zoom entire layer 1');
//整图显示第一层
olemapinfo.do('set map distance units "m"');
//定义单位
olemapinfo.do('set map layer 1 editable on');
//定义第一层可编辑

end;


function TForm1.openmap(filename: string): boolean;
begin

olemapinfo.do('open table "'+FileName+'"');
end;


procedure TForm1.SpeedButton6Click(Sender: TObject);
begin

olemapinfo.RunMenuCommand(1701);
end;


procedure TForm1.SpeedButton4Click(Sender: TObject);
begin

oleMapInfo.RunMenuCommand(1705);
end;


procedure TForm1.SpeedButton5Click(Sender: TObject);
begin

oleMapInfo.RunMenuCommand(1706);
end;


procedure TForm1.SpeedButton3Click(Sender: TObject);
begin

oleMapInfo.RunMenuCommand(1702);
end;


procedure TForm1.SpeedButton10Click(Sender: TObject);
begin

oleMapInfo.RunMenuCommand(1709);
end;


procedure TForm1.SpeedButton11Click(Sender: TObject);
begin

oleMapInfo.RunMenuCommand(1710);
end;


procedure TForm1.SpeedButton8Click(Sender: TObject);
begin

oleMapInfo.RunMenuCommand(801);
end;


end.
 
多人接受答案了。
 
后退
顶部