Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
474 views
in Technique[技术] by (71.8m points)

windows - Is there a tool for exploring/testing COM objects?

I'm trying to automate a process by using a COM object from Python (win32com), but I'm not getting the expected results... Is there a tool to explore/test COM objects without having to write a specific program? I mean, is there something that allows e.g. to instantiate a COM object and call its methods?

(Basically I'm trying to find out if my unexpected results are win32com's fault, and I'd like to avoid installing Visual Studio to write a C# app)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I actually wrote a replacement for the SDK tool OleView (afaik it doesn't support calling methods only enumerating) unimaginatively called OleViewDotNet. You can get the source code here but as you'd need to compile it's likely it would be quicker to write the simple C# program or use Powershell.

What it does do is expose IDispatch methods (and some native interfaces) via a GUI so you can call them and it also provides an IronPython script window. You'd need to find your COM object by looking under "Registry -> CLSID By Name", find the entry (the filter can be used to select by name part) right click and select "Create Instance" that should show up a window similar to:

object information

then select the "Operations" menu at the bottom and choose "Open Dispatch" to get the method/property window.

enter image description here

There's a lot more you can do with this but that's a simple overview.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...