<?xml version="1.0" encoding="UTF-8" ?>
<feed xml:lang="ja" xmlns="http://www.w3.org/2005/Atom">
	<generator uri="http://nucleuscms.org/" version="Nucleus CMS v3.31SP1-kes">Nucleus CMS v3.31SP1-kes</generator>

	<id>http://fireball.loafer.jp/kes/</id>
	<link rel="self" type="application/atom+xml" href="http://fireball.loafer.jp/kes/atom.xml" />
	<link rel="related" type="text/html" href="http://fireball.loafer.jp/" />
	<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/" />

	<rights>© 2008 Project Loafer/Project Fireball and all blog writers.</rights>

	<title>Entering Passive Mode</title>
	<subtitle>やる気のない受け身なブログ。実験場。</subtitle>

	<updated>2006-12-08T23:58:00+09:00</updated>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="COM" scheme="http://fireball.loafer.jp/kes/com/" />
		<content type="html">
<![CDATA[
<p>
さて、お膳立ては整ったので、DLL に<br />
DllRegisterServer と DllUnregisterServer を実装しよう。
</p>
<p>
========== library.cpp ==========
</p>
<p>
// （…前略…）<br />
// （…DllMain…）<br />
// （…DllGetClassObject…）<br />
// （…DllCanUnloadNow…）<br />
// （…WriteRegistryStringValue…）<br />
// （…DeleteRegistryValue…）<br />
// （…RegisterIconOverlayHandler…）<br />
// （…UnregisterIconOverlayHandler…）
</p>
<a href="http://fireball.loafer.jp/kes/com/article_361.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/com/article_361.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/com/article_361.html" />
		<published>2006-12-08T23:58:00+09:00</published>
		<title type="html"><![CDATA[DllRegisterServer/DllUnregisterServer]]></title>
		<updated>2006-12-08T23:58:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="COM" scheme="http://fireball.loafer.jp/kes/com/" />
		<content type="html">
<![CDATA[
<p>
昨日作った WriteRegistryStringValue を使うと、<br />
COM クラスとエクステンションの登録処理を、<br />
少しは見やすく書くことができる。
</p>
<p>
========== library.cpp ==========
</p>
<p>
// （…前略…）<br />
// （…DllMain…）<br />
// （…DllGetClassObject…）<br />
// （…DllCanUnloadNow…）<br />
// （…WriteRegistryStringValue…）<br />
// （…DeleteRegistryValue…）
</p>
<a href="http://fireball.loafer.jp/kes/com/article_360.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/com/article_360.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/com/article_360.html" />
		<published>2006-12-07T23:50:00+09:00</published>
		<title type="html"><![CDATA[COM クラスとエクステンションの登録処理]]></title>
		<updated>2006-12-07T23:50:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="COM" scheme="http://fireball.loafer.jp/kes/com/" />
		<content type="html">
<![CDATA[
<p>
さて、必要な機能は全て実装したのだが、<br />
一般的なインプロセスサーバとして完成させるには、<br />
あともう少しやるべきことがある。
</p>
<p>
インプロセスサーバは、DLL をコピーするだけでは動作せず、<br />
サーバに含まれる COM クラスを公開するために、<br />
レジストリに登録する必要があった。
</p>
<p>
レジストリの登録情報は、DLL のパスに依存しているため、<br />
インプロセスサーバをシステムにインストールする際に、<br />
レジストリファイルを相手に配るのは現実的ではない。
</p>
<a href="http://fireball.loafer.jp/kes/com/article_359.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/com/article_359.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/com/article_359.html" />
		<published>2006-12-06T23:29:00+09:00</published>
		<title type="html"><![CDATA[インプロセスサーバの自己登録機能]]></title>
		<updated>2006-12-06T23:29:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="COM" scheme="http://fireball.loafer.jp/kes/com/" />
		<content type="html">
<![CDATA[
<div>
<a href="http://fireball.loafer.jp/kes?imagepopup=2/2006-12-05-21-12-0.jpg&amp;width=363&amp;height=341&amp;imagetext=%E3%82%B8%E3%83%A3%E3%83%B3%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A8%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80%E3%83%AA%E3%83%B3%E3%82%AF" onclick="window.open(this.href,'imagepopup','status=no,toolbar=no,scrollbars=no,resizable=yes,width=363,height=341');return false;" class="thumbnail"><img src="http://media.fireball.loafer.jp/thumbnail/2_2006-12-05-21-12-0.jpg" width="120" height="113" alt="ジャンクションとフォルダリンク" title="ジャンクションとフォルダリンク" /></a>
</div>
<p>
新たに作成した 2 クラスの動作をテストしよう。
</p>
<p>
HardLinkIconID クラスの時と同じように、<br />
まずはレジストリファイルを作成して登録することにする。
</p>
<p>
■レジストリへの登録<br />
<a href="http://mixi.jp/view_diary.pl?id=281240938&amp;owner_id=2300658" onclick="javascript:window.open(this.href, '_blank'); return false;">http://mixi.jp/view_diary.pl?id=281240938&amp;owner_id=2300658</a>
</p>
<p>
レジストリへの登録はクラス単位なので、<br />
同じようなエントリが 3 つ並ぶことになる。
</p>
<a href="http://fireball.loafer.jp/kes/com/article_358.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/com/article_358.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/com/article_358.html" />
		<published>2006-12-05T21:12:00+09:00</published>
		<title type="html"><![CDATA[追加クラスのテスト]]></title>
		<updated>2006-12-05T21:12:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="COM" scheme="http://fireball.loafer.jp/kes/com/" />
		<content type="html">
<![CDATA[
<p>
テンプレートクラスは、定義しただけでは何の効果もない。<br />
テンプレートの引数に具体的なクラス型を与えることで、<br />
テンプレートを元にしたクラスの実体が定義される。<br />
これを、「テンプレートのインスタンス化」と呼ぶ。
</p>
<p>
では、DllGetClassObject を書き換えて、<br />
他の 2 クラスも公開できるように修正する。<br />
どうせなら、HardLinkIconID にもテンプレートを使おう。
</p>
<p>
=========== library.cpp ==========
</p>
<a href="http://fireball.loafer.jp/kes/com/article_357.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/com/article_357.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/com/article_357.html" />
		<published>2006-12-04T22:31:00+09:00</published>
		<title type="html"><![CDATA[テンプレートクラスのインスタンス]]></title>
		<updated>2006-12-04T22:31:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="COM" scheme="http://fireball.loafer.jp/kes/com/" />
		<content type="html">
<![CDATA[
<p>
新しく作った 2 つのクラスにもクラスオブジェクトが必要だ。<br />
これも HardLinkIconIDClass をコピーして作ることができる。
</p>
<p>
■HardLinkIconIDClass クラス<br />
<a href="http://mixi.jp/view_diary.pl?id=277138945&amp;owner_id=2300658" onclick="javascript:window.open(this.href, '_blank'); return false;">http://mixi.jp/view_diary.pl?id=277138945&amp;owner_id=2300658</a>
</p>
<p>
HardLinkIconIDClass を見てみると、実装のほとんどが、<br />
IClassFactory のための一般的なもので、<br />
クラス固有の部分は、新しい HardLinkIconID の<br />
インスタンスを作成する部分だけだ。
</p>
<a href="http://fireball.loafer.jp/kes/com/article_356.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/com/article_356.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/com/article_356.html" />
		<published>2006-12-03T23:58:00+09:00</published>
		<title type="html"><![CDATA[ClassObject テンプレートクラス]]></title>
		<updated>2006-12-03T23:58:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="COM" scheme="http://fireball.loafer.jp/kes/com/" />
		<content type="html">
<![CDATA[
<p>
この勢いで、フォルダリンク（フォルダショートカット）の、<br />
FolderLinkIconID クラスも作り上げてしまおう。
</p>
<p>
やはり似たようなソースになることが想定されるので、<br />
HardLinkIconID からコピーして作ることにする。
</p>
<p>
========== FolderLinkIconID.hpp ==========
</p>
<p>
#ifndef folderlinkiconid_hpp_included<br />
#define folderlinkiconid_hpp_included
</p>
<a href="http://fireball.loafer.jp/kes/com/article_355.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/com/article_355.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/com/article_355.html" />
		<published>2006-12-02T23:56:00+09:00</published>
		<title type="html"><![CDATA[FolderLinkIconID クラス]]></title>
		<updated>2006-12-02T23:56:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="COM" scheme="http://fireball.loafer.jp/kes/com/" />
		<content type="html">
<![CDATA[
<p>
アイコンは 3 種類用意しているが、<br />
まだ 1 つしかクラスを作っていなかった。<br />
今日はマウントポイント用のクラスを作ることにする。
</p>
<p>
クラス名は「MountPointIconID」とする。<br />
基本的な部分は HardLinkIconID と変わらないので、<br />
HardLinkIconID をコピーして作ると速い。<br />
まずは、クラスの定義を作成する。
</p>
<p>
========== MountPointIconID.hpp ==========
</p>
<a href="http://fireball.loafer.jp/kes/com/article_354.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/com/article_354.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/com/article_354.html" />
		<published>2006-12-01T23:53:00+09:00</published>
		<title type="html"><![CDATA[MountPointIconID クラス]]></title>
		<updated>2006-12-01T23:53:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="COM" scheme="http://fireball.loafer.jp/kes/com/" />
		<content type="html">
<![CDATA[
<div>
<a href="http://fireball.loafer.jp/kes?imagepopup=2/2006-11-30-23-41-0.jpg&amp;width=596&amp;height=373&amp;imagetext=%E3%83%8F%E3%83%BC%E3%83%89%E3%83%AA%E3%83%B3%E3%82%AF" onclick="window.open(this.href,'imagepopup','status=no,toolbar=no,scrollbars=no,resizable=yes,width=596,height=373');return false;" class="thumbnail"><img src="http://media.fireball.loafer.jp/thumbnail/2_2006-11-30-23-41-0.jpg" width="120" height="75" alt="ハードリンク" title="ハードリンク" /></a>
</div>
<p>
COM サーバをレジストリに登録し、<br />
実際にアイコンが表示されるかどうか試してみよう。
</p>
<p>
レジストリへの登録内容は昨日書いたとおりだが、<br />
登録は COM クラス単位で行うので、<br />
複数の COM クラスを提供するサーバの場合、<br />
その数だけ登録する必要がある。
</p>
<p>
本来はプログラムから登録を行うのだが、<br />
この時点ではまだ動作確認だけでよいので、<br />
レジストリへの登録や登録解除は、<br />
レジストリファイルを使うことにしよう。
</p>
<a href="http://fireball.loafer.jp/kes/com/article_353.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/com/article_353.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/com/article_353.html" />
		<published>2006-11-30T23:41:00+09:00</published>
		<title type="html"><![CDATA[レジストリへの登録]]></title>
		<updated>2006-11-30T23:41:00+09:00</updated>
	</entry>
	<entry>
		<author>
			<name>kes</name>
			<uri>http://loafer.jp</uri>
		</author>
		<category term="COM" scheme="http://fireball.loafer.jp/kes/com/" />
		<content type="html">
<![CDATA[
<p>
インプロセスサーバの DLL が完成しても、<br />
そのままでは COM 基盤はその存在を知る事ができない。<br />
そこで、COM 基盤からサーバを呼び出せるように、<br />
レジストリに情報を登録する必要がある。
</p>
<p>
COM クラスの情報は、HKEY_CLASSES_ROOT\CLSID の配下の、<br />
{クラス ID} のキーに格納する。<br />
キーのデフォルト値には、クラスの説明文字列を入れる。<br />
これは人間が利用するための情報であり、必須ではない。
</p>
<p>
インプロセスサーバを登録する場合は、<br />
更に InProcServer32 というサブキーを作成し<br />
キーのデフォルト値に、DLL のファイル名を入れる。<br />
これで、COM クラスと提供サーバの関連付けが行われるのだ。
</p>
<a href="http://fireball.loafer.jp/kes/com/article_352.html">続きを読む</a>
]]>
		</content>
		<id>http://fireball.loafer.jp/kes/com/article_352.html</id>
		<link rel="alternate" type="text/html" href="http://fireball.loafer.jp/kes/com/article_352.html" />
		<published>2006-11-29T23:56:00+09:00</published>
		<title type="html"><![CDATA[スレッディングモデル]]></title>
		<updated>2006-11-29T23:56:00+09:00</updated>
	</entry>

</feed>
