1 New ActiveX Library
2 New(Add) Com Object
3 定义 Com 接口
4 实现 Com 接口
5 编译注册服务(及其中又 IIS)
6 编写测试用的 .ASP
7 测试

解决方案 »

  1.   

    片断::
      TMapObj = class(TASPObject, IMapObj)
      protected
        procedure OnEndPage; safecall;
        procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
        function GenNewFile: WideString; safecall;
        function Get_MaxZoom: Double; safecall;
        function Get_PBottom: Double; safecall;
        function Get_PHeight: Double; safecall;
        function Get_PLeft: Double; safecall;
        function Get_PObjID: SYSINT; safecall;
        function Get_PObjName: WideString; safecall;
        function Get_PObjURL: WideString; safecall;
        function Get_PObjX: Double; safecall;
        function Get_PObjY: Double; safecall;
        function Get_PRight: Double; safecall;
        function Get_PTop: Double; safecall;
        function Get_PWidth: Double; safecall;
        procedure AddLayerFromTable(const TableName, Param: WideString); safecall;
        procedure AddLayerFromTXT(const FileName: WideString); safecall;
        procedure AddLine(const Name: WideString; X1, Y1, X2, Y2: Double);ASp::
    'Create Map Object
    Set Session("Map")=Server.CreateObject("WebGis.MapObj")
     ASBPath=server.mappath("/Dzwebgis/")
     Session("Map").MapName 0,"MainMap"
     Session("Map").SetMapPath  ASBPath
     Session("Map").SetMapDName "MapImages"
     Session("Map").ConnectionStr "slserver","dzcatv","dzcatv"
    ' Open map