if working with the Windows version of Object Rexx it is very worthwhile to use Object Rexx for remote controlling Windows applications via ActiveX/OLE-automation.
However, many times it is very hard to find the documentation about the interfaces to such Windows programs. This is where the utility "rgf_oleinfo.hta" comes into play: this is a set of Object Rexx programs (one embedded in HTML) which allows interrogating such ActiveX/OLE-programs and renders the results as HTML files. This has the benefit, that one is able to print the results with the help of the browser, thereby gaining a printed documentation of those interfaces. Something, at least I like to have myself.
If you want to see how such a rendering may look like, here is a rendering about the interfaces the Microsoft Internet Explorere (MSIE) publishes:
rgf_oleinfo.css
".
CSS even allow for defining formatting rules
depending on the media, e.g. screen and printer. So, it may be worthwhile to look
into this technology (cf. http://www.w3c.org).
First-time users: just get "Open Object Rexx" (ooRexx, went opensource in the spring of 2005) from http://www.ooRexx.org and install it.
IBM Object REXX users: You need Object Rexx at level 2.1.2, the update (available since 2002-12)can be downloaded via the "Support download" section at: http://www-3.ibm.com/software/ad/obj-rexx/support.html
The Object Rexx utilities (all source code given) needed are stored in the following archive: http://wi.wu-wien.ac.at/rgf/rexx/orx08/orx8_200505.zip
their documentation can be found in: http://wi.wu-wien.ac.at/rgf/rexx/orx08/Part1.pdf and http://wi.wu-wien.ac.at/rgf/rexx/orx08/Part2.pdf.
The Object Rexx programs for querying the ActiveX/OLE-interfaces with Object Rexx
are located in the archive:
http://wi.wu-wien.ac.at/rgf/rexx/orx15/rgf_oleinfo.zip
The presentation can be found here: http://wi.wu-wien.ac.at/rgf/rexx/orx15/2004_orx15_ORX-Win-2.pdf
The article can be found here: http://wi.wu-wien.ac.at/rgf/rexx/orx15/2004_orx15_orx-win.pdf
rgf_oleinfo.hta
" rgf_oleinfo.hta
" (the extension ".hta"
denotes "HTML-applications")
PATH
" points to the utility programs of orx8_99;
if the problems persist, change the security settings of MSIE such, that your
locally stored files/programs can execute without restrictions
rgf_oleconstants.rex
"::requires-file
for OLE constants.
rgf_oleconstants appid/clsid [outfile]
appid/clsid
... OLE/ActiveX application ID
or CLSID
outfile
... optional name of the outputfile, otherwise STDOUT is used
use the above outfile in a "::requires" directive
which then allows you to use the defined constants, e.g.
.ole.const~SWC_3RDPARTY
example:
rexx rgf_oleconstants InternetExplorer.Application msie_const.rex
... then, whenever you need to access MSIE-constants, then merely use
::requires msie_const.rex
and refer to them e.g. like
.ole.const~csc_navigateBack
hint: one may use any combinations of such created files, as they all use the
same directory object to map the constant names to their values (ie. you
may ::requires
as many OLE-constant Rexx-files as you need (e.g.
the constants of InternetExplorer, Excel, Eudora etc.)
rgf_oleinfo.rex
"
Additional infos to the supplied utility "rgf_oleinfo.rex
":
VT_DISPATCH
"), here's the syntax:
res=rgf_oleinfo(app_name | ole_object [, [header] [, [mode] [, [display]]]] )
... invocation as a function, e.g. from *any* running Object Rexx program, returns .true, if OLEObject could get created|interrogated, .false else
where:
app_name
ole_object
header
mode
display
... 0|1 no display (0) or display=default (1) with Internet Explorer
example (called from a running Rexx program):
ole=.OleObject~new("InternetExplorer.Application")
success=rgf_oleinfo(ole, "Interfaces for the Internet Explorer")
rexx rgf_oleinfo.rex app_name [mode [display]]
app_name
PROGID
or a CLSID
mode
display
example (command-line):
rexx rgf_oleinfo InternetExplorer.Application 1 1
rgf_oleinfo.css
"
rgf_oleinfo.wsc
"
REXX.OLEinfo
" is available with the method/function:
analyze( ProgID_or_OLEobject [, [stringHTML_Header]
[, [boolCompactRendering] [, boolDisplayImmediatelyInMSIE]]] )
test_rexx_oleinfo.js
":
// JScript var mxVar, myVar // create an instance of the Object Rexx COM class to serve as a passthrue mxVar = new ActiveXObject("Rexx.OLEinfo") // create an instance of the Internet Explorer myVar = new ActiveXObject("InternetExplorer.Application") // now analyze and render the OLE/ActiveX object mxVar.analyze(myVar, "invoked via JScript !")
test_rexx_oleinfo.vbs
":
' VBScript dim mxVar, myVar ' create an instance of the Object Rexx COM class to serve as a passthrue Set mxVar = createObject("Rexx.OLEinfo") ' create an instance of the Internet Explorer Set myVar = createObject("InternetExplorer.Application") ' now analyze and render the OLE/ActiveX object ' OLEobject *must* be enclosed in parenthesis, otherwise the default string value is retrieved! mxVar.analyze (myVar)
... please note for Visual Basic and VBScript: you need to enclose the variable referencing an OLE/ActiveX object in parenthesis, otherwise it may happen that instead the default string value is supplied/retrieved instead (not yielding the OLE/ActiveX object itself)!
test_rexx_oleinfo.js
" or
"test_rexx_oleinfo.vbs
"
Please post any comments, problems, qeustions, etc. here in news:comp.lang.rexx