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

Categories

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

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

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...