COM 서버의 프로세스 ID 가져 오기
-
15-11-2019 - |
문제
Windows 메시지의 조합을 HWNDS로 직접 보내고 자동화 된 응용 프로그램에서 노출 된 COM 서버에 대한 호출을 통해 자동화를 수행하고 있습니다.
둘 이상의 인스턴스가 실행 중이면 COM 서버의 프로세스 ID를 결정할 수 있어야합니다.
실행중인 객체 테이블을 사용하여 실행중인 모든 COM 서버를 열거하고 모든 객체에 대해 Monikers를 가져올 수 있지만 COM 객체 자체는 창 핸들, 스레드 ID, 프로세스 ID 또는 모든 것을 얻는 데 사용할 수있는 방법이 없습니다.그 종류의.
모니 커 또는 모니 커의 실제 바인딩 COM 객체를 기반으로, 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.