Curl Global Community
ActiveX の情報をしりたい - Printable Version

+- Curl Global Community (https://communities.curl.com)
+-- Forum: Discussions (https://communities.curl.com/forumdisplay.php?fid=1)
+--- Forum: General Curl questions (https://communities.curl.com/forumdisplay.php?fid=2)
+--- Thread: ActiveX の情報をしりたい (/showthread.php?tid=1032)



ActiveX の情報をしりたい - umemura - 01-28-2014

ActiveXObject を利用する際に、そのオブジェクトが、どんなメソッドを持っているかなどの情報を知りたいです。
どのような方法がありますか。



RE: ActiveX の情報をしりたい - umemura - 01-28-2014

詳細は、仕様が記載されているサイトなどで確認すべきでしょうが、
いちおう、ActiveXObject から情報を取得できます。

Code:
{import * from CURL.GRAPHICS.ACTIVEX}

{define-proc public {get-active-x-info
                        xobj:ActiveXObject
                    }:StringBuf

    def strb = {StringBuf}

    def tb = "\t"
    def rtn = "\n"

    ||基本情報
    {strb.concat "【ActiveX基本情報】" & rtn }
    {strb.concat "CLSID" & tb & xobj.com-clsid  & rtn }
    {strb.concat "固有ID" & tb & xobj.com-identity & rtn }
    {strb.concat rtn }


    ||ゲッター
    {strb.concat "【ゲッター】" & rtn }
    {if xobj.getter-count > 0 then
        {strb.concat "名前" & tb & "型" & tb & "説明" & rtn }

    }
    {for i:int = 0  below xobj.getter-count do
      def  inf:ActiveXFieldInfo = {xobj.get-getter-info i}
        {strb.concat inf.name & tb & inf.type.type & inf.description & rtn }
    }
    {strb.concat rtn }

    ||セッター
    {strb.concat "【セッター】" & rtn }
    {if xobj.setter-count > 0 then
        {strb.concat "名前" & tb & "型" & tb & "説明" & rtn }
    }
    {for i:int = 0  below xobj.setter-count do
      def  inf:ActiveXFieldInfo = {xobj.get-setter-info i}
        {strb.concat inf.name & tb & inf.type.type & inf.description & rtn }
    }
    {strb.concat rtn }


    ||イベント
    {strb.concat "【イベント】" & rtn }
    {for i:int = 0  below xobj.event-count do
      def  inf:ActiveXMethodInfo  = {xobj.get-event-info i}
        {strb.concat "■名前" & tb & inf.name & rtn }
        {strb.concat " 戻値" & tb & inf.return-type.type & rtn }
        {strb.concat " 引数" }

        {if inf.arg-count > 0 then
            {strb.concat  rtn & tb & "型" & tb & "INパラメータ?" & tb & "OUTパラメータ?" & tb & "オプション?" & rtn }
         else
            {strb.concat tb & "なし" & rtn}
        }
        {for j:int = 0  below inf.arg-count do
            def arg-inf:ActiveXArgInfo = {inf.arg-type j}
            {strb.concat tb & arg-inf.type & tb & arg-inf.in? & tb & arg-inf.out? & tb & arg-inf.optional?  & rtn }
        }
        {strb.concat " 説明" & tb & inf.description & rtn }

    }
    {strb.concat rtn }



    {strb.concat "【メソッド】" & rtn }
    {for i:int = 0  below xobj.method-count do
        def  inf:ActiveXMethodInfo  = {xobj.get-method-info i}
        {strb.concat "■名前" & tb & inf.name & rtn }
        {strb.concat " 戻値" & tb & inf.return-type.type & rtn }
        {strb.concat " 引数" }

        {if inf.arg-count > 0 then
            {strb.concat  rtn & tb & "型" & tb & "INパラメータ?" & tb & "OUTパラメータ?" & tb & "オプション?" & rtn }
         else
            {strb.concat tb & "なし" & rtn}
        }
        {for j:int = 0  below inf.arg-count do
            def arg-inf:ActiveXArgInfo = {inf.arg-type j}
            {strb.concat tb & arg-inf.type & tb & arg-inf.in? & tb &arg-inf.out? & tb & arg-inf.optional?  & rtn }
        }
        {strb.concat " 説明" & tb & inf.description & rtn }

    }
    {strb.concat rtn }


    {return strb}

}

{def xobj =
    {ActiveXObject
        ClsId = |"{8E27C92B-1264-101C-8A2F-040224009C02}"|
    }
}

{def ta = {TextArea width = 4in, height = 5in}}
{CommandButton
    label = "対象のActiveXの情報を取得",
    {on Action do
        def strb = {get-active-x-info xobj}
        set ta.value = {strb.to-String}
    }
}

{value ta}