zoukankan      html  css  js  c++  java
  • Delphi 做ActiveX的详细过程

    1、新建

    如下图

    点击OK

    依然点击OK

    出现了如上图的节面,就像窗体一样。

    然后 你就想干什么干什么。

    这个做好之后,

    这个是我设计的窗体。

    然后 就添加 外部可以调用的接口了。

    如果你不想让外部调用 就 可以直接像平时用Delphi一样,该干什么干什么。

    代码
    procedure Set_SnapBuffer(Value: Integer); safecall;
    procedure Set_Visible(Value: WordBool); safecall;
    procedure MessageShow(Value:WideString);safecall;{这个是我自己添加的}
    public
    { Public declarations }
    procedure Initialize; override;
    end;

    implementation

    然后在下面 写上

    1 procedure TActiveFormX.MessageShow(value:WideString);
    2  begin
    3 Application.MessageBox(PChar(edit1.Text), '提示', MB_OK);
    4  end;

    以上过程就把 接口写完了。接下来,配置环境然后来调试。

    出现如下节面

    然后如下填写

    点击OK

    如果你的代码没有写错 就直接通过了

    然后

    设置启动参数

    就可以运行了。

    当然是允许了。

    然后就出现

    这个时候 你就要修改html代码了

    <HTML>
    <H1> Delphi 7 ActiveX Test Page </H1><p>
    You should see your Delphi 7 forms or controls embedded in the form below.
    <HR><center><P>
    <OBJECT
    	  classid="clsid:C4BB6130-AE39-4EDB-98E1-BBAC3089496D"
    	  codebase="http://localhost/ActiveFormProj1.ocx#version=1,0,0,0"
    	  width=350
    	  height=250
    	  align=center
    	  hspace=0
    	  vspace=0
    	  ID=jsShow//这个是我添加的
    >
    </OBJECT>
    <script>
    jsShow.MessageShow("");//本来不需要参数的,设计失误啊!
    </script>
    </HTML>
    
    
  • 相关阅读:
    Coding 账户与 本地 Git 客户端的配置
    leetcode_sort-list
    leetcode_insertion-sort-list
    leetcode_move-zeroes
    search-insert-position
    leetcode_remove-nth-node-from-end-of-list
    leetcode_queue-reconstruction-by-height
    leetcode_valid-parentheses
    leetcode_swap-nodes-in-pairs
    20201115-东北师范大学-助教-周总结-第9次
  • 原文地址:https://www.cnblogs.com/LearningC/p/1894748.html
Copyright © 2011-2022 走看看