Hatena::Groupmoz-addon

Ci.nsIZIGOROu

2007-10-25生まれて初めての鼻血

Windows Script Component (2)

| 19:43 |  Windows Script Component (2) - Ci.nsIZIGOROu を含むブックマーク はてなブックマーク -  Windows Script Component (2) - Ci.nsIZIGOROu

prototypeについて(修正1: 2007-10-26T02:26:59+09:00)

結論から言うと事実上使えない。工夫次第で使える。

公開していないメソッド・プロパティ

使える。

プロパティのEnumerate

内部的には可能。

createComponent(追記1: 2007-10-26T01:28:10+09:00)

たとえ同じwsc内でも異なるComponentの呼び出しを介しているのでActiveXObject扱いになる。

なのでcreateComponentで作ったobjectはfor in出来ない。

script要素のsrc属性(追記2: 2007-10-26T01:38:12+09:00)

使えた!!!これは大きい。

まとめ(追記3: 2007-10-26T02:26:59+09:00)

今度この辺りはまとめるけど、

  • 実装の外部化が可能。
  • prototypeも普通に使えるが、大事な事は二つある。
    • 公開するメソッド、プロパティはGlobalオブジェクトのプロパティに置かねばならない
    • Globalオブジェクトのプロパティだからメソッド中にthisと書いたらGlobalオブジェクトを指す
  • って事はprototypeをfor-in出来れば、まるっとGlobalにもってくればいい。(applyしてだけど)

Globalに公開しないとってのが気持ち悪いけど止むを得ないんだろうなー。

そもそもJScriptで書けるけど、JScriptだけの為にあるもんじゃないし。

KansagaraKansagara2012/07/21 06:16What a joy to find such clear thniknig. Thanks for posting!

ftucdwozftucdwoz2012/07/22 01:37Sh9Khg <a href="http://blzjkaulenhj.com/">blzjkaulenhj</a>

bhqxsrbhqxsr2012/07/24 03:49QyzWJ9 , [url=http://xiefoewbcbyn.com/]xiefoewbcbyn[/url], [link=http://sifqkmuuaxqy.com/]sifqkmuuaxqy[/link], http://wyfdyebamytu.com/

jtaletiirkjtaletiirk2018/08/06 17:15<a href="http://livecopys.com">best online pharmacy for viagra</a> cheap price viagra http://livecopys.com

qtaletxnylqtaletxnyl2018/08/07 13:08<a href="http://rabbitinahat.com">how to order cialis</a> order cialis from canada http://rabbitinahat.com

mtaletkuhkmtaletkuhk2018/08/18 08:46<a href="http://gigawatt6.com">how long does it take cialis 10mg to work</a> cialis free shipping http://gigawatt6.com

ntaletzvnnntaletzvnn2018/08/18 10:04<a href="http://gigawatt6.com">cialis free</a> nitric oxide and cialis http://gigawatt6.com

dtaletjugcdtaletjugc2018/08/18 13:56<a href="http://missreplicawatches.com">buy cialis professional</a> cialis lower back pain http://missreplicawatches.com

utaletqritutaletqrit2018/08/18 15:02<a href="http://mphasset.com">printable coupons for viagra</a> viagra sex stories http://mphasset.com

ftaletenidftaletenid2018/08/18 18:04<a href="http://rabbitinahat.com">female cialis side effects</a> cialis for hypertension http://rabbitinahat.com

italetdwzuitaletdwzu2018/08/18 19:03<a href="http://istanbulexpressonline.com">what are the main ingredients in viagra</a> does viagra help you last longer http://istanbulexpressonline.com

ytaletkxfmytaletkxfm2018/08/18 21:45<a href="http://rabbitinahat.com">cialis generic pills</a> does cialis make you last longer http://rabbitinahat.com

ftaletosnvftaletosnv2018/08/19 00:57<a href="http://baymontelreno.com">cialis from india</a> cialis com free sample http://baymontelreno.com

ztaletexloztaletexlo2018/08/19 07:55<a href="http://gigawatt6.com">how much does cialis 20 mg cost</a> cialis alcohol side effects http://gigawatt6.com

ltaletyhfsltaletyhfs2018/08/19 12:47<a href="http://bullsac.com">levitra premature ejaculation</a> where to get levitra http://bullsac.com

htaletymkahtaletymka2018/08/19 21:17<a href="http://missreplicawatches.com">where can i get cialis</a> cialis instructions for use http://missreplicawatches.com

ctaletykmqctaletykmq2018/08/20 00:13<a href="http://missreplicawatches.com">20 mg cialis</a> what is cialis tadalafil http://missreplicawatches.com

jtaletpengjtaletpeng2018/08/20 09:50<a href="http://psychologytweets.com">cialis for daily use side effects</a> cialis doses available http://psychologytweets.com

stalethwnustalethwnu2018/09/11 10:48<a href="http://psychologytweets.com">cialis starts working</a> cialis 20mg how long does it take to work http://psychologytweets.com

ltaletxunjltaletxunj2018/09/11 12:42<a href="http://rabbitinahat.com">cialis 50 mg</a> buy cialis cheap http://rabbitinahat.com

btaletkenwbtaletkenw2018/09/11 13:33<a href="http://mphasset.com">viagra price per pill</a> can viagra be used by females http://mphasset.com

etaletfvyfetaletfvyf2018/09/11 18:50<a href="http://gigawatt6.com">liquid cialis review</a> cialis 5 mg best price http://gigawatt6.com

ttalettufvttalettufv2018/09/11 22:24<a href="http://baymontelreno.com">cheapest price on cialis</a> cialis 5 mg online http://baymontelreno.com

ttaletjddottaletjddo2018/09/12 04:42<a href="http://top-monterey-salinas-dentists.com">how long does levitra take to work</a> levitra free trial coupon http://top-monterey-salinas-dentists.com

staletbwfsstaletbwfs2018/09/12 05:34<a href="http://missreplicawatches.com">cheap cialis online usa</a> order cialis paypal http://missreplicawatches.com

htaletalsahtaletalsa2018/09/12 12:20<a href="http://canadian-pharmabuy.com">cheap pill viagra</a> generic viagra 100mg http://canadian-pharmabuy.com

ftaletldwtftaletldwt2018/09/12 14:38<a href="http://top-monterey-salinas-dentists.com">levitra pe</a> how long does levitra last in your system http://top-monterey-salinas-dentists.com

rtaletgxpfrtaletgxpf2018/09/12 15:00<a href="http://usedrestaurantequipmentaz.com">real cialis online</a> order cialis uk http://usedrestaurantequipmentaz.com

ctaletotfuctaletotfu2018/09/12 20:00<a href="http://h-m-j.com">generic viagra canada</a> how to buy viagra http://h-m-j.com

ataletkenfataletkenf2018/09/12 21:25<a href="http://valladium.com">best place to buy cialis online</a> order generic cialis online http://valladium.com

etaletfwqaetaletfwqa2018/09/12 22:06<a href="http://zbloggers.com">propecia hair regrowth</a> propecia regrowth http://zbloggers.com

vtaletlflmvtaletlflm2018/09/12 22:15<a href="http://valladium.com">cialis online usa</a> buy brand cialis online http://valladium.com

gtaletwhasgtaletwhas2018/09/12 23:13<a href="http://motechautomotive.com">mail order cialis</a> cialis for sale online http://motechautomotive.com

dtaletetxmdtaletetxm2018/09/12 23:18<a href="http://canadian-pharmasale.com">buy cialis online with prescription</a> generic cialis india pharmacy http://canadian-pharmasale.com

wtaletbkptwtaletbkpt2018/09/13 02:30<a href="http://waltzweekend.com">order generic viagra</a> viagra coupons http://waltzweekend.com

wtaletuxblwtaletuxbl2018/09/13 05:15<a href="http://vico4me.com">buy viagra cheaply</a> viagra online no prescription http://vico4me.com

xtaletinzixtaletinzi2018/09/13 07:18<a href="http://canadian-pharmasale.com">buy cialis canadian pharmacy</a> cialis online with prescription http://canadian-pharmasale.com

btalettlgpbtalettlgp2018/09/13 11:50<a href="http://vico4me.com">canadian viagra online</a> generic viagra http://vico4me.com

staletlkyvstaletlkyv2018/09/13 14:44<a href="http://valladium.com">mail order cialis from canada</a> buy cialis overnight delivery http://valladium.com

ztaletzhgdztaletzhgd2018/09/13 17:25<a href="http://rabbitinahat.com">cheap cialis 20mg pills</a> cialis canada order http://rabbitinahat.com

ataletthyzataletthyz2018/09/13 19:55<a href="http://canadian-pharmabuy.com">cheap viagra online</a> order viagra using paypal http://canadian-pharmabuy.com

etaletzraoetaletzrao2018/09/13 22:10<a href="http://valladium.com">order cialis with no prescription</a> order 5mg cialis online http://valladium.com

ptaletpvssptaletpvss2018/09/13 23:51<a href="http://canadian-pharmabuy.com">order herbal viagra</a> buy viagra in mexico http://canadian-pharmabuy.com

otaletzrnrotaletzrnr2018/09/14 01:05<a href="http://gigawatt6.com">cialis online without prescription</a> order cialis online in canada http://gigawatt6.com

etaletkjfzetaletkjfz2018/09/14 02:39<a href="http://gigawatt6.com">buy cialis with prescription</a> canadian pharmacy cialis generic http://gigawatt6.com

ttaletsbupttaletsbup2018/09/14 04:41<a href="http://timsbmw.com">levitra dosage</a> which is better viagra cialis or levitra http://timsbmw.com

ptaletqrfrptaletqrfr2018/09/14 05:55<a href="http://valladium.com">cialis cheap price</a> cialis 20mg online http://valladium.com

wtaletdoubwtaletdoub2018/09/14 06:49<a href="http://valladium.com">order cialis with paypal</a> buy cialis canada pharmacy http://valladium.com

ctaletwugpctaletwugp2018/09/14 10:38<a href="http://usedrestaurantequipmentaz.com">cialis originale online</a> cialis 5 mg http://usedrestaurantequipmentaz.com

jtaletnsdbjtaletnsdb2018/09/14 20:54<a href="http://baymontelreno.com">buy generic cialis</a> buy cialis 5mg http://baymontelreno.com

ttalettghxttalettghx2018/09/14 21:42<a href="http://istanbulexpressonline.com">discount order viagra</a> order viagra online india http://istanbulexpressonline.com

gtaleteizwgtaleteizw2018/09/14 22:08<a href="http://buycialisonl1ne.us">buy cialis online without prescription</a> cialis 5mg best price http://buycialisonl1ne.us

ataletohmmataletohmm2018/09/14 22:49[url=http://top-monterey-salinas-dentists.com]levitra and cialis taken together[/url] levitra canada http://top-monterey-salinas-dentists.com

rtaletxlurrtaletxlur2018/09/15 00:11<a href="http://rabbitinahat.com">generic cialis no prescription</a> cialis online canada http://rabbitinahat.com

vtaletqlslvtaletqlsl2018/09/15 03:34<a href="http://valladium.com">buy cialis 5mg</a> generic cialis online http://valladium.com

ntaletacspntaletacsp2018/09/15 06:44<a href="http://buycialisonl1ne.us">cialis by mail order</a> order cialis online cheap http://buycialisonl1ne.us

htaletwxzmhtaletwxzm2018/09/15 09:56<a href="http://gigawatt6.com">buy cialis online canada pharmacy</a> cialis coupon http://gigawatt6.com

italetfpgjitaletfpgj2018/09/15 10:39<a href="http://valladium.com">generic cialis from india</a> where to buy cialis online http://valladium.com

etalettutietalettuti2018/09/15 17:39<a href="http://bullsac.com">does levitra work for women</a> online levitra http://bullsac.com

ltaletcvseltaletcvse2018/09/15 20:01<a href="http://canadian-pharmasale.com">canadian online pharmacy generic cialis</a> generic cialis without a prescription http://canadian-pharmasale.com

rtaletrxpzrtaletrxpz2018/09/16 00:19<a href="http://usedrestaurantequipmentaz.com">discount cialis pills</a> buy cialis non prescription http://usedrestaurantequipmentaz.com

ktaletekxaktaletekxa2018/09/16 01:33<a href="http://zbloggers.com">propecia hair regrowth</a> propecia success http://zbloggers.com

dtaletnznldtaletnznl2018/09/16 07:14<a href="http://canadian-pharmasale.com">generic cialis india pharmacy</a> order generic cialis http://canadian-pharmasale.com

btaletjpafbtaletjpaf2018/09/16 11:01<a href="http://missreplicawatches.com">buy cialis 20 mg</a> cheap cialis sale online http://missreplicawatches.com

otaletfdlyotaletfdly2018/09/16 11:25<a href="http://valladium.com">buy cialis with prescription</a> cheap cialis uk http://valladium.com

ytalettgmmytalettgmm2018/09/16 11:47<a href="http://rabbitinahat.com">cialis order online india</a> buy cialis online prescription http://rabbitinahat.com

ptaletypwfptaletypwf2018/09/16 13:40<a href="http://rabbitinahat.com">order cialis in canada</a> cheap cialis 5mg uk http://rabbitinahat.com

utalethwytutalethwyt2018/09/16 14:11<a href="http://top-monterey-salinas-dentists.com">levitra vs viagra</a> price of levitra http://top-monterey-salinas-dentists.com

ftaletlbrbftaletlbrb2018/09/16 22:50<a href="http://timsbmw.com">levitra trial coupon</a> levitra and viagra together http://timsbmw.com

vtaletvkdtvtaletvkdt2018/09/16 23:31<a href="http://buycialisonlineglka.com">cheap cialis in canada</a> buy cialis online canada http://buycialisonlineglka.com

btaletdelrbtaletdelr2018/09/17 00:04<a href="http://timsbmw.com">cheap levitra</a> levitra or viagra which is best http://timsbmw.com

ltaletfvnyltaletfvny2018/09/17 07:25<a href="http://top-monterey-salinas-dentists.com">does levitra work better than viagra</a> how to make levitra work better http://top-monterey-salinas-dentists.com

htaletmcrkhtaletmcrk2018/09/17 09:14<a href="http://unishade.com">viagra cialis online</a> how to order cialis http://unishade.com

btaletevqjbtaletevqj2018/09/17 09:41<a href="http://bullsac.com">levitra vs cialis vs viagra</a> levitra price http://bullsac.com

dtaletynzedtaletynze2018/09/17 13:12<a href="http://buycialisonl1ne.us">cheap cialis from india</a> cialis coupons online http://buycialisonl1ne.us

utaletilvsutaletilvs2018/09/17 17:34<a href="http://missreplicawatches.com">cialis coupons online</a> cheap cialis 10mg http://missreplicawatches.com

htalethhlzhtalethhlz2018/09/17 17:59<a href="http://zbloggers.com">generic propecia cost</a> propecia timeline http://zbloggers.com

ktaletsfptktaletsfpt2018/09/18 02:19<a href="http://canadian-pharmabuy.com">best place to buy viagra</a> buy real viagra online cheap http://canadian-pharmabuy.com

staletfhokstaletfhok2018/09/18 02:47<a href="http://waltzweekend.com">buy viagra online cheap</a> viagra from canada http://waltzweekend.com

utaletkfbbutaletkfbb2018/09/18 11:43<a href="http://timsbmw.com">levitra and alcohol</a> women levitra http://timsbmw.com

ftaletbcpcftaletbcpc2018/09/18 20:06<a href="http://istanbulexpressonline.com">cheap viagra in usa</a> viagra cost per pill http://istanbulexpressonline.com

ctaletabujctaletabuj2018/09/18 22:36<a href="http://timsbmw.com">viagra cialis levitra comparison chart</a> which works better viagra or cialis or levitra http://timsbmw.com

ntaletdlayntaletdlay2018/09/18 23:16<a href="http://missreplicawatches.com">cialis online with prescription</a> buy cialis usa http://missreplicawatches.com

wtaletszeuwtaletszeu2018/09/18 23:57<a href="http://viciolatino.com">viagra prices</a> generic viagra mail order http://viciolatino.com

ctaletjbigctaletjbig2018/09/19 06:48<a href="http://buyviagraonl1ne.us">order generic viagra</a> viagra price per pill http://buyviagraonl1ne.us

rtaletjzyvrtaletjzyv2018/09/19 07:55<a href="http://canadian-pharmabuy.com">buy viagra internet</a> viagra online no prescription http://canadian-pharmabuy.com

ptaletkzmcptaletkzmc2018/09/19 10:59<a href="http://canadian-pharmasale.com">generic cialis from india</a> buy generic cialis online http://canadian-pharmasale.com

ataletrixcataletrixc2018/09/19 17:20<a href="http://usedrestaurantequipmentaz.com">cheap cialis 20mg online</a> buy cialis online us http://usedrestaurantequipmentaz.com

jtaletzsqdjtaletzsqd2018/09/19 17:57<a href="http://top-monterey-salinas-dentists.com">directions for taking levitra</a> levitra is used for http://top-monterey-salinas-dentists.com

staletusacstaletusac2018/09/19 18:56<a href="http://h-m-j.com">buy viagra online discount</a> generic viagra from canada http://h-m-j.com

staletwvcvstaletwvcv2018/09/19 19:52<a href="http://valladium.com">cheap cialis prices uk</a> order cialis uk http://valladium.com

italetwsgtitaletwsgt2018/09/19 22:06<a href="http://canadian-pharmasale.com">order cialis now</a> order cialis online with prescription http://canadian-pharmasale.com

dtaletjygvdtaletjygv2018/09/20 02:24<a href="http://canadian-pharmaonline.com">buy viagra order</a> buy female viagra http://canadian-pharmaonline.com

otaletdrbootaletdrbo2018/09/20 03:34<a href="http://missreplicawatches.com">buy cialis online in usa</a> cialis online no prescription http://missreplicawatches.com

italetbgnxitaletbgnx2018/09/20 09:12<a href="http://bullsac.com">levitra and alcohol</a> levitra professional http://bullsac.com

dtaletivjpdtaletivjp2018/09/20 10:01<a href="http://gigawatt6.com">cheap cialis uk generic</a> best place to buy cialis online http://gigawatt6.com

ktaletrnulktaletrnul2018/09/20 13:35<a href="http://motechautomotive.com">buy cialis overnight delivery</a> can you order cialis online http://motechautomotive.com

staletiygostaletiygo2018/09/20 14:08<a href="http://missreplicawatches.com">order cialis online without prescription</a> buy real cialis http://missreplicawatches.com

staletxnhjstaletxnhj2018/09/20 17:39<a href="http://canadian-pharmasale.com">real cialis online</a> buy generic cialis 20 mg http://canadian-pharmasale.com

jtaletvkwhjtaletvkwh2018/09/20 19:52<a href="http://top-monterey-salinas-dentists.com">levitra 20 mg film coated tablets</a> levitra canada online http://top-monterey-salinas-dentists.com

ptaletjddaptaletjdda2018/09/20 21:34<a href="http://baymontelreno.com">buy cialis from canada</a> brand cialis name online order http://baymontelreno.com

gtaletswrbgtaletswrb2018/09/20 23:00<a href="http://motechautomotive.com">mail order cialis online</a> cheap viagra cialis uk http://motechautomotive.com

ztalethyvvztalethyvv2018/09/21 04:04<a href="http://baymontelreno.com">discount generic cialis</a> order cialis online with prescription http://baymontelreno.com

rtaletbmuhrtaletbmuh2018/09/21 05:01<a href="http://buyviagraonl1ne.us">buy viagra overnight</a> viagra online uk http://buyviagraonl1ne.us

utaletbqhdutaletbqhd2018/09/21 06:04<a href="http://unishade.com">where to buy cialis online</a> mail order viagra cialis http://unishade.com

ltaletninvltaletninv2018/09/21 06:24<a href="http://timsbmw.com">levitra is used for</a> order cheap levitra http://timsbmw.com

etaletmbboetaletmbbo2018/09/21 06:25<a href="http://unishade.com">buy cialis 20 mg</a> cialis order online india http://unishade.com

2007-10-23

Windows Script Component (1)

| 02:19 |  Windows Script Component (1) - Ci.nsIZIGOROu を含むブックマーク はてなブックマーク -  Windows Script Component (1) - Ci.nsIZIGOROu

Windows Script Componentとは?

(ActiveScriptがサポートする)スクリプト言語でActiveXコントロールが作れる枠組みの事。

MozillaだったらJavaScriptでXPCOMを実装するような感じだと考えて構わない。

wscファイルの作り方

基本はXMLファイルです。複数のコントロールを同時に作る事が可能。

基本的な構造
<?xml version="1.0" encoding="utf-8"?>
<package>
  <component id="Counter" />
  <component id="AnotherComponent" />
</package>
componentの中に記述すること
regstration要素
progid, classid(CLSID), version, descriptinの定義*1
public要素
公開するプロパティ、メソッド、イベントの定義
script要素
各言語での実装*2

registration要素のサンプル

<registration
  description="Sample Counter Component"
  progid="SampleComponent.Counter"
  version="1.00"
  classid="{B49187E5-946E-4A07-A1C1-C0BC02659B94}"
>
  <script language="JScript">
    <![CDATA[
function Register() {
  // このコンポーネントが登録される際に実行される処理
}

function Unregister() {
  // このコンポーネントが削除される際に実行される処理
}
    ]]>
  </script>
</registration>

public要素のサンプル

<public>
  <property name="count">
    <get/>
    <put/>
  </property>
  <method name="incrCount">
    <parameter name="duration"/>
  </method>
  <method name="decrCount">
    <parameter name="duration"/>
  </method>
  <event name="OnIncr" />
  <event name="OnDecr" />
</public>

script要素のサンプル

<script language="JScript">
  <![CDATA[
var description = new SampleComponentCounter();

function IEReplObserverService() {
  this.get_counter = get_counter;
  this.put_counter = put_counter;

  this.incrCount = incrCount;
  this.decrCount = decrCount;
}

var counter = 0;

function get_conter() {
  return counter;
}

function put_counter(newValue) {
  counter = newValue;
}

function incrCount(duration) {
  fireEvent("OnIncr", counter, duration);
  counter += duration;
}

function decrCount(duration) {
  fireEvent("OnDecr", counter, duration);
  counter -= duration;
}
  ]]>
</script>

今の所分かってること

  • 作った後で右クリックしてレジストリに登録しないと使えません
  • Component.prototypeで必要なメソッドやプロパティを定義してもどうも動作しないっぽぃ。公開するプロパティとメソッドはGlobalオブジェクトに居ないとダメみたい。prototypeプロパティ自体には定義は出来る。

まだ試してないこと

  • 公開としていないプロパティ、メソッドが宣言できるか、また使えるかどうか。
  • WSCの中で他のコンポーネントを呼び出した際に、COMイベントを処理出来るか。(多分出来ない)
    • そもそもWScriptオブジェクトが無いので、CreateObject, ConnectObjectが出来ない
    • やるならActiveXObject, object要素のいずれか
    • object要素はevents属性でそのobjectのイベントを使うかどうかある。id属性で指定した値で多分出来るとは思うんだけど、動的にobject要素の生成は出来ないハズ。

まぁ動的に出来たらちと危険かw

*1:レジストリに登録される

*2:これはまた今度