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.
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.
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.
精彩评论