- PR -

リモートでCOM+の呼び方

1
投稿者投稿内容
きつつき
会議室デビュー日: 2001/10/21
投稿数: 14
投稿日時: 2008-01-29 22:05
C#で開発を行っているのですが、
別サーバーの登録してある.NET作成のCOM+アプリケーションを
利用する方法が分かりません。プロトコルは、DCOMを利用します。

いろいろ調べましたが、該当する資料が見つかりませんでした。

ヒントでも構いませんので、ご教授をお願いします。
Tdnr_Sym
ぬし
会議室デビュー日: 2005/09/13
投稿数: 464
お住まい・勤務地: 明石・神戸
投稿日時: 2008-01-30 12:23
こんにちは。

引用:

きつつきさんの書き込み (2008-01-29 22:05) より:
C#で開発を行っているのですが、
別サーバーの登録してある.NET作成のCOM+アプリケーションを
利用する方法が分かりません。プロトコルは、DCOMを利用します。

いろいろ調べましたが、該当する資料が見つかりませんでした。

ヒントでも構いませんので、ご教授をお願いします。



試せる環境がないので未検証ですが、下記の記事は参考にならないですか?

DCOM Interop (msdn)
引用:

Using the wrapper classes seems simple enough, so why would you ever want to consider moving beyond RCW and write your wrapper classes by hand? Well, what if the COM object in question, ACOMObject.Test, was located on a remote machine? What would you do then?

It turns out that you can use the Activator class of the System namespace for remote access, so the previous example would look like the following:


コード:
Type type = Type.GetTypeFromProgId ("ACOMObject.Test", "MachineName");
Object objTest = Activator.CreateInstance (type);
objTest.Foo();




1

スキルアップ/キャリアアップ(JOB@IT)