From: Georgios Petasis on
Doing some more tweaking, I currently have the following:

package require tcom
set analyzer [::tcom::ref createobject PageAnalyzer.LayoutAnalyzer2]
$analyzer Initialize 0

set explorer [::tcom::ref createobject InternetExplorer.Application]
$explorer Visible 0
$explorer Navigate2 about:blank
set document [$explorer Document]

set url_doc [$document createDocumentFromUrl \
http://www.ellogon.org]
puts "Handle: $url_doc"

$analyzer -method Analyze4 $url_doc [expr {5}]

The error I get is:

Handle: ::tcom::handle0x00910330
0x80004003 {Invalid pointer}
while executing
"$analyzer -method Analyze4 $url_doc [expr {5}]"

It seems that there is a problem with the conversion of $url_doc to
a pointer value?

George

O/H Georgios Petasis ������:
> Hi all,
>
> I am trying to use tcom in order to analyse a web page with the VIPS
> algorithm. The VIPS ActiveX dll can be found at:
>
> http://www.ews.uiuc.edu/~dengcai2/VIPS/VIPS.html
> http://www.ews.uiuc.edu/~dengcai2/VIPS/VIPSdll_2006-01-16.zip
>
> This ActiveX dll has the following interface (as returned by
> set interface [::tcom::info interface handle]; $interface methods)
>
> 1 DISPATCH FOMPage {}
> 2 VOID Initialize {{in I4 dwPara}}
> 3 VOID Analyze4 {{in DISPATCH pHtmlDoc} {in VARIANT nGranularity}}
> 4 VOID AnalyzeOutputAll_Text {{in DISPATCH pHtmlDoc} {in VARIANT
> nGranularity}}
> 5 BSTR getResult {}
> 6 VOID AnalyzeNews {{in DISPATCH pHtmlDoc} {in VARIANT nGranularity}}
> 7 VOID AnalyzeImg {{in DISPATCH pHtmlDoc}}
>
> I can succesfully create an instance of this dll:
>
> set analyzer [::tcom::ref createobject PageAnalyzer.LayoutAnalyzer2]
> $analyzer Initialize 0
>
> Now, I want to use the Analyze4 method. From an example C++ code that
> uses the DLL, I have:
> MSHTML::IHTMLDocument2Ptr pHTMLDoc = m_webBrowser.GetDocument();
> m_pLayoutAnalyzer->Analyze4(pHTMLDoc,_variant_t((long)m_iPDOC));
> MSXML2::IXMLDOMDocumentPtr pFOMPage = m_pLayoutAnalyzer->GetFOMPage();
>
> What I am trying to do, is to pass a document from internet explorer:
>
> set ie [::tcom::ref createobject InternetExplorer.Application]
> $ie Navigate2 <some_url>
> set document [$ie Document]
> $analyzer -method Analyze4 $document 5
>
> The last call returns an error:
> 0x80004002 {No such interface supported}
>
> Any ideas?
>
> George
 | 
Pages: 1
Prev: [Urgent]: Tcom question...
Next: tclx on opensuse