Sign in to follow this  
Followers 0
GEOSoft

Object methods

18 posts in this topic

Has anyone figured out how to get a list of all the properties and methods that are avilable in a com object?


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

That you cant do.. but you can try to search for it.. I'll look for the link on the forum somewhere.. but the best is to look in the programs helpfile..

Well I found this

http://www.autoitscript.com/forum/index.php?showtopic=38671

http://www.autoitscript.com/forum/index.php?showtopic=35784

But i didnt found the forum I looked for.. well I think it was Dale that had some program to lure some object

Edited by Shevilie

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

That you cant do.. but you can try to search for it.. I'll look for the link on the forum somewhere.. but the best is to look in the programs helpfile..

Well I found this

http://www.autoitscript.com/forum/index.php?showtopic=38671

http://www.autoitscript.com/forum/index.php?showtopic=35784

But i didnt found the forum I looked for.. well I think it was Dale that had some program to lure some object

Thanks a lot. The first link looks like it may help a bit.

I'll see what I can do.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Search for TLViewer. I posted a link some days ago.

Thanks @Uten. Searching now

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

And the Obj/COM Reference section in the helpfile has a write-up on this as well.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

And the Obj/COM Reference section in the helpfile has a write-up on this as well.

Dale

I read that Dale but it was of little help.

I need to find all of the available properties, methods and events for a given object. Currenly that's an ADO object but there are others that I need to check as well. So far it's been trial and error. Find 1 that works and then try others that seem that they might. I've been looking for the best method to enumerate all of the tables available i a database without much luck.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

These two are pretty good too:

COM Assistant - requires you to navigate to the Dll/Exe, but pretty easy from there.

http://www.devcomponents.com/comassistant/

ActiveX/COM Inspector - overkill for most things, but you can browse available COM objects by ProgId, and even instantiate one, and play around with it. Or you can attach to some currently running COM object (outlook fer instance). This one is the hardest to use that I've come across, but it works great once you know what you're doing.

http://www.oaklandsoftware.com/product_com.../product_3.html


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

I read that Dale but it was of little help.

I need to find all of the available properties, methods and events for a given object. Currenly that's an ADO object but there are others that I need to check as well. So far it's been trial and error. Find 1 that works and then try others that seem that they might. I've been looking for the best method to enumerate all of the tables available i a database without much luck.

And you installed and used the OLE/COM Object Viewer that it describes? That is what it does... same with some of the other tools like the TLViewer also mentioned.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

And you installed and used the OLE/COM Object Viewer that it describes? That is what it does... same with some of the other tools like the TLViewer also mentioned.

Dale

OLE/COM Object viewer has been intalled on my system since I first installed VS6 and that's been a few years now. I just downloaded TLViewer today so I'll be playing with that.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

ActiveX/COM Inspector - overkill for most things, but you can browse available COM objects by ProgId, and even instantiate one, and play around with it. Or you can attach to some currently running COM object (outlook fer instance). This one is the hardest to use that I've come across, but it works great once you know what you're doing.

http://www.oaklandsoftware.com/product_com.../product_3.html

I have to agree - this is the best one I've found. It lets you interact with the objects in real time, and even invoke methods (with parameters) on the fly. It takes some getting used to, however.

-S


(Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent]

Share this post


Link to post
Share on other sites

I am trying to see the methods and parameter lists using any of the above tools but I am getting lost.

For instance, I am browsing the excelcom_udf and I see calls like:

$oExcel.Selection.Find(etc,,,,)

or

$oExcel.Selection.Replace(etc,,,,)

I should be able to point the TLV tool at EXCEL9.olb and drill down to see the same method name and parameter list, but how?

Problem is there is a lot of info, and a lot of entries that kinda look like they would apply but don't match.

Share this post


Link to post
Share on other sites

No, I think you want to point it at "Excel.Application". In any case, if you already have Excel running with something selected, using ActiveX/COM Inspector, you should be able to connect to that existing instance of Excel, and drill down through the methods that way.

But if you are creating a new instance, well, it's not very likely that you'll have anything selected with that instance, right?


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

Well, Application.Selection just shows as an object without any way to drill further, whereas Application.SendKeys() is clearly a method with two parameters. That is what I am expecting to see.

I admit the concepts are a bit fuzzy to me, but the COM objects that allow you to monkey with a spreadsheet are not part of the spreadsheet itself are they? If you take an xls file and drop in onto a machine without excel installed, you won't be able to use COM on it. Those methods are defined as part of an exe, dll, olb or other file. If thats the case, then every parameter list for every method has to be defined in this file doesn't it?

Besides, the tool (TLV) is setup to point at files, not running processes....

Share this post


Link to post
Share on other sites

Correct, they're not part of the spreadsheet, they're part of Excel.

Every parameter for every method... well that's kind of missing the point. The objects that are there are created dynamically, depending on the workbook you have open, and the active worksheet, and the currently selected range. You have to open the spreadsheet using COM.

You might make more progress using AutoIt, and picking apart the ExcelCOM UDF. What is it you are trying to do? Here's a quick example. Open a spreadsheet, and select a range of cells, then run this:

$oExcel = ObjGet ("", "Excel.Application")
ConsoleWrite("Open Workbooks: " & $oExcel.Application.Workbooks.count & @CRLF)
ConsoleWrite("Active Workbook: " & $oExcel.Application.ActiveWorkBook.fullname & @CRLF)
$CurrentRange = $oExcel.Application.Activewindow.RangeSelection.Address
$oExcel.Application.Range($CurrentRange).font.bold = 1

It will set the range of cells you have selected Bold. Hope that gets you started. :whistle:


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

OK, I downloaded the ActiveX/COM Inspector and I see what you mean. Looking at things dynamically shows what is going on at the time. Still, if I wanted a comprehensive list of every method and property I would expect to be able to get that by examining the lib directly. I think these other tools should let me do that, I just haven't figured it out.

What I have been after is a better understanding of COM so that I could spin my own COM enabled autoit scripts as needed. I have written a small app using ExcelCOM_UDF and I ran across the situation where the low level call to $oExcel.Selection.Find() and $oExcel.Selection.Replace() does not work as expected with Excel 2000 but it does with Excel 2003. I needed to see what the COM interface really looked like for these calls. If I am reading it right, the Inspector shows these calls to have fewer parameters with Excel 2000.

Share this post


Link to post
Share on other sites

what you're looking for is the same functionality I want to insert in Scite..

just like Visual Studio (and Primal script) you can indeed enumerate all instances, methods and properties in any object using a set of code components.

these features are called intellisense (Wiki)

if primal script can do it for any registered DLL on your system, this functionality can be inserted in scite also..

I'm not a developper so I'm sweating while I investigate this but it doesn 't look so complex to be honest.

it consists of 5 or so pieces of code


Share this post


Link to post
Share on other sites

I noticed that for Acrobat 5, ActiveX/COM Inspector does not show anything in the running COM object window which is confusing since it looks like Acrobat 5 does have a COM interface and AutoIt scripts can do things like:

(from posted code)

$SourcePDF = ObjCreate("AcroExch.PDDoc")

$SourcePDF.InsertPages()

$SourcePDF.Save()

$SourcePDF.Close

Also, I can drill down in the right pane of ACI and see:

Adobe Acrobat 5.0 Type Library->DispInterfaces->CAcroPDDoc.InsertPages() including the various parameters

The question is, once I have examined the library and found a method like InsertPages() that I'd like to use, how do I know to

use ObjCreate("AcroExch.PDDoc") to get at that method? The string "AcroExch" does not appear in the library, so where is this mapping made?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0