Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Query on webbrowser.dll on HTC Touch WM6


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-08-2008, 09:56 PM
Senior Member
 
Join Date: Mar 2008
Posts: 114
Default Query on webbrowser.dll on HTC Touch WM6

Hello,

Just a quicky (I hope). One of my beta testers has reported an issue when using the web control (using webbrowser.dll) on a HTC Touch unit with Windows mobile 6.

When clicking on a link inside wen control, my app traps the URL (using navigatingURL) and stores the link in a variable and then cancels navigation, which works great on WM5 / 2003.

But my tester using it it on the above device (and WM6) gives an error:

"This url is not properly formatted. Please verify that you have entered the correct addresss"

Anyone any hints on how to prevent this? Do we think it could be the HTC unit or WM6 incompatibility with webbrowser?

The error seems to be generated from Internet Explorer.



Thank you.

Last edited by badkarma : 04-08-2008 at 10:22 PM.
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 10:22 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,896
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

I assume this happens before it hits your navigating event handler. My guess is that whatever you are using as the URL does not look like a "real" URL and that unlike earlier versions WM6 tries to parse it before it tries to navigate to it. You can try making it look like a real URL by putting "http://" before it or you could try prefixing it with "about:" which might also work.
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 04:15 PM
Senior Member
 
Join Date: Mar 2008
Posts: 114
Default

Thanks for the reply agraham,

Curiously, when receiving the hyperlink currently, I have to strip off the first 11 characters which make up the hyperlink as the first 11 characters of the returned hyperlink are "about:BLANK"

So if I had a hyperlink called LAMP (<a href="LAMP">) then the web.NavigatingURL returns "about:BLANKLAMP".

I have just recoded the app on the hyperlinks so the hyperlinks are now <a href="about:LAMP"> and this then adjusts the return from web.NavigatingURL as about:LAMP, which is probably now the correct format (I guess).

Am I right in thinking that because I am not putting "about:" in before my 'internal' link of "LAMP", that WM6 Operating is kicking in before WebnavigatingURL runs (O/S I guess runs WEBNavigatingURL ) and does a quick pre-check before running WebNavigatingURL which then grumbles as LAMP is not a hyperlink - but then after that, WebNavigatingURL adds "about:BLANK" and then adds the link to it before presenting it through itself to the output of WebNavigatingURL?

I think the above is how it works - which makes sense. So what I will do now is recompile the application and send it to my beta tester with the HTC Touch/WM6 and ask him to retry... I guess then it will work as the "precheck" of the O/S of WM6 will be happy that a "about:" is present in the link...

Thanks again agraham for your help.

(PS: I have just tried putting in http:// also but if the clicking on "http://LAMP", it does not then run Web.NavigatingURL but instead attemps to go to http://LAMP and then (obviously) gets a "404 Page Not Found". So I guess "about:" is the way forward.)

Last edited by badkarma : 04-09-2008 at 04:19 PM.
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 04:54 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,896
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by badkarma View Post
Am I right in thinking...
Probably but your guess is as good as mine. I am a Systems Engineer not an HTML man and it is unclear to me as to what "about:" is about but it seems to be to do with local status or navigation or ... stuff (anyone ) but I know it seems to solve problems sometimes. Lets hope it works this time!

Quote:
(PS: I have just tried putting in http:// also but if the clicking on "http://LAMP", it does not then run Web.NavigatingURL but instead attemps to go to http://LAMP and then (obviously) gets a "404 Page Not Found".
I don't understand this. Are you saying that the Navigating event doesn't fire so you can't cancel it?
Reply With Quote
  #5 (permalink)  
Old 04-09-2008, 05:09 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,334
Default

Maybe the "file://" prefix will be useful here.
Reply With Quote
  #6 (permalink)  
Old 04-10-2008, 08:54 PM
Senior Member
 
Join Date: Mar 2008
Posts: 114
Default

File:// I guess would probably be OK too... thanks Erel.

I recomiled my app last night and sent it to the chap who has the WM6 PDA and he reports the issue has now gone away so about:LAMP is cool.

agraham - I will retest the http:// to see if I can reproduce the issue of it not calling the NavigatingURL method before jumping to the htp page and will report back ...

Thanks guys
Reply With Quote
  #7 (permalink)  
Old 04-10-2008, 10:12 PM
Senior Member
 
Join Date: Mar 2008
Posts: 114
Default

OK chaps I have tested the http:// bit.

I have a "webby" web browser control

I have a sub "webby_Navigating" which has a msgbox(webby_NavigatingURL) as the first command in it so I know when this sub is kicking in.

When I use a hyperlink with "<a href='about:LAMP'>" it triggers the webby_Navigating and then I can cancel the navigation, however if I have a "http://LAMP" hyperlink, the webby_Navigating is not called because no msgbox appears.

It doesnt matter for me as I am using the about: for internal use only.

However I have noticed that on my daughters ipaq 3870 (windows 4..20 O/S) that before (when I was just using "<a href='LAMP'>"), when you clicked on this link, nothing happened and the control stayed the same (I was thinking the OS just did not navigate at all) however, now setting the link as "<a href='about:LAMP'>" the 3870 device now navigates once the hyperlink is clicked on but (I think as stated ealier the navigating sub is not triggered on this old OS) it navigates to a white background control and says LAMP as the text ...

So now, I am looking for code for checking O/S version so I can auto turn off hyperlinks if Windows OS = 4.20 ... unless I can do a post nav check to read webby.documenttext to check for "LAMP" and if so run my code which should have run under navigating ... I need to look into this a bit more ...

If you need more info, please let me know.

Cheers

Last edited by badkarma : 04-10-2008 at 10:17 PM.
Reply With Quote
  #8 (permalink)  
Old 04-11-2008, 10:44 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,896
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Microsoft state that "Full functionality for the WebBrowser in .NET Compact Framework applications requires Windows Mobile version 5.0 software for Pocket PCs and Smartphones." This implies that partial functionality is available on earlier OSs. However, from your experience, it looks like the behaviour on earlier OS versions can be quite variable and not consistent.
Quote:
Originally Posted by badkarma View Post
... unless I can do a post nav check to read webby.documenttext to check for "LAMP"
Unfortunately there is no way to access the contents of DocumentText - from the Microsoft docs "You can use DocumentText to present HTML to your users, such as to provide links and a simple HTML form, but the .NET Compact Framework does not support accessing the HTML content of a Web page with this property."

You may have noticed this new thread Windows PDA version querying re versioning.
Reply With Quote
  #9 (permalink)  
Old 04-11-2008, 12:45 PM
Senior Member
 
Join Date: Mar 2008
Posts: 114
Default

Thanks for the reply agraham, I will take a peek at the library also.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
A query to Erel mozaharul Questions & Help Needed 5 04-28-2008 12:21 PM
Code optimization & dll query gangsta Questions & Help Needed 9 03-29-2008 10:28 AM
Touch style standard calc Alex812 Share Your Creations 2 12-17-2007 02:05 PM
Microsoft Access Query somersetrc Questions & Help Needed 2 11-29-2007 09:29 AM
Howto disalbe touch screen ? lee inmo Questions & Help Needed 2 11-09-2007 12:54 AM


All times are GMT. The time now is 01:14 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0