WebBrowser and list of elements

T

Tony

Folks,

I noticed that Compact Framework 2.0 now has WebBrowser control - but
is it possible to somehow retrieve Document object of a current loaded
page, like we have HtmlDocument Document in the Full Framework 2.0?


Thanks,
Antony
 
S

Sergey Bogdanov

I'm not sure that it's possible using standard WebBrowser from CF2.0.
But you may try to embed htmlview control into a form and then using
SendMessage with DTM_DOCUMENTDISPATCH to retrieve IHTMLDocument interface.

Take a look at this sample which demonstrates how to enumerate all links
in the current page (tested on WM5.0 PPC):
http://www.sergeybogdanov.com/samples/HTMLViewCF2.zip

HTH
 
W

wzhang85

I downloadedhttp://www.sergeybogdanov.com/samples/HTMLViewCF2.zip,
and listed all links in VB.Net.
I noticed that Document2 not working, when I try to list images or All, an exception occurs.
Could anyone tell me how to fix the problem and how to define other interfaces, like innerHTML?
I couldn't find DispID for other functions.
Thank you in advance.

Fromhttp://www.google.co.jp/search?sourceid=navclient&hl=ja&ie=UTF-8&rlz=...

Posted via DevelopmentNow.com Groupshttp://www.developmentnow.com/g/

Just for anyone who is interested in this topic, I will give the
answer I found.
I found the answer in a Chinese page http://www.cnblogs.com/Endink/archive/2009/02/17/1391902.html
The core is as following:
In MobileSDK folder, you can find a file named wevw.idl. Use the
following command to create a .tlb file.
/I option can used to specify the directory of the .idl file.
midl /D UNDER_CE webwv.idl
Then from VS command, use tlbimp to create Com Callable Wrappers
(CCWs)$B!$(B.dll.
tlbimp webvm.tlb /out:webvm.dll
After you import the .tlb into you project, all the HTML document
interfaces can be used.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top