質問

自動化されたWindowsメッセージの組み合わせにより、自動化されたアプリケーションによって公開されているCOMサーバーへの呼び出しを介して自動化しています。

複数のインスタンスが実行されている場合は、COMサーバのプロセスIDを判断できるようにして、Windowsメッセージを送信しているものとしてCOM呼び出しと同じインスタンスを押すことができます。

実行中のオブジェクトテーブルを使用して、実行中のすべてのCOMサーバーを列挙し、それらすべてのモニカを復元することができますが、COMオブジェクト自体は、ウィンドウハンドル、スレッドID、プロセスID、または何でも使用できるメソッドを公開しません。その種類の。

モニカのMonikerまたは実際のバインディングコムオブジェクトに基づいて、COMサーバのプロセスIDが何であるかを把握する方法はありますか?

ありがとう!

役に立ちましたか?

解決

If you control (write code for) both the server and the client you can add a method to your COM interface that would return the process / thread ID or anything of this nature (e.g. server hostname if it is remote) on the server end. I second @Hans - unless you have access to the server implementation you may be out of luck by design.

他のヒント

I believe the kimgr CoGetServerPID function will give you the process-id of your COM server.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top