Is there a way to watch all COM activity on a computer?

时光怂恿深爱的人放手 提交于 2019-12-07 08:02:46

问题


I'm trying to deal with a piece of specialized hardware, that presents it's interface as a COM object, using win32com in Python.

However, the documentation for how to actually set up the hardware through the COM object is sparse (it requires a significant amount of initialization), and entirely oriented at using a bunch of pre-built libraries for Visual Studio, which are not accessible through python.

That said, is there any way to watch all local COM activity, so I can sort through the activity logs to try and figure out how the existing demo programs properly initialize the hardware, and replicate the behavior in my python script?

Ideally, there would be something in the vein of wireshark for doing this.

Note: I have very little (read: basically no) experience using COM, as my focus is mostly embedded hardware (and a little python dev on the side). However, I'm stuck with this particular device.


回答1:


Try Deviare COM Spy Console.

Com Spy Console allows users to monitor applications using Component Object Model's interfaces. You are able to spy which interfaces are being created and see how the applications are using them by intercepting the calls to its member functions.

Spy on any ActiveX / OLE32 calls monitoring all members of these COM objects.

You can download it for free.




回答2:


Another nice trick is to use Process Monitor to watch registry activity related to COM/COM+. Basically access to keys like HKLM\Software\Classes\CLSID{SOME-GUID}.

This helped me tons of times to find problems with components not correctly registered in the system.



来源:https://stackoverflow.com/questions/3067784/is-there-a-way-to-watch-all-com-activity-on-a-computer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!