-
May 3rd, 2015, 04:50 PM
#1
Thread Starter
Lively Member
VB6 WebBrowser problem... a serious problem!
Hi forum,
I've a VB6 project within a WebBrowser control on the main form.
I use it for visualize a map of the city with GoogleMaps.
Recently it gives me this error: "This browser is not more supported".
I'm using Internet Explorer 8 on a XP operative system... the latest browser for Windows XP.
Support for Windows XP and Internet Explorer 8 on Windows XP has ended.
How can I resolve my problem?
I need a space on my form where I can visualize a GoogleMaps map.
Thanks.
Andrea
-
May 3rd, 2015, 05:41 PM
#2
Re: VB6 WebBrowser problem... a serious problem!
It think its because the webbrowser control does not get updated in the registry when upgrading IE so please follow this link either mine or Schmidt (which is a class and a lot easier to use) solution should work. Let me know if it works!
http://www.vbforums.com/showthread.p...ght=Webbrowser
Edit: sorry forgot to add link
Last edited by Max187Boucher; May 3rd, 2015 at 06:02 PM.
-
May 3rd, 2015, 05:44 PM
#3
Re: VB6 WebBrowser problem... a serious problem!
Dont have time to look into it but i think they have a google map API not sure if its free or not. But if my first suggestion does not work then you could have a look at the api.
I thought there was an example lately in the forums maybe search for google api.
Edit:
You could always use Internet explorer window (either reference it or CreateObject) and use SetParent API to set it into your form. There is a SetParent api example in the link i provided if interested.
Last edited by Max187Boucher; May 3rd, 2015 at 06:20 PM.
-
May 4th, 2015, 01:26 AM
#4
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by Max187Boucher
Dont have time to look into it but i think they have a google map API not sure if its free or not.
Sure, the API is there and it's free.
Please take a look at this thread here (post #4):
http://www.vbforums.com/showthread.p...=1#post4641473
There I've offered a Demo-Zip, which is only based on a normal (Std-Project-Private) VB6-Usercontrol,
and nothing else (no IE-Control, no API).
@Saturnus83
Here's what it looks like - and what it supports:
Olaf
-
May 4th, 2015, 08:44 AM
#5
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by saturnus83
Hi forum,
I've a VB6 project within a WebBrowser control on the main form.
I use it for visualize a map of the city with GoogleMaps.
Recently it gives me this error: "This browser is not more supported".
I'm using Internet Explorer 8 on a XP operative system... the latest browser for Windows XP.
Support for Windows XP and Internet Explorer 8 on Windows XP has ended.
How can I resolve my problem?
I need a space on my form where I can visualize a GoogleMaps map.
Thanks.
Andrea
Do you register you app under FEATURE_BROWSER_EMULATION registry key? I not, you are actually using IE7 engine in the WebBrowser control.
Try searching this forum for further explanations.
cheers,
</wqw>
-
May 4th, 2015, 08:58 AM
#6
Thread Starter
Lively Member
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by Schmidt
Sure, the API is there and it's free.
Please take a look at this thread here (post #4):
http://www.vbforums.com/showthread.p...=1#post4641473
There I've offered a Demo-Zip, which is only based on a normal (Std-Project-Private) VB6-Usercontrol,
and nothing else (no IE-Control, no API).
@Saturnus83
Here's what it looks like - and what it supports:
Olaf
Thanks... very nice program! I'll study it!
-
May 4th, 2015, 09:00 AM
#7
Thread Starter
Lively Member
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by wqweto
Do you register you app under FEATURE_BROWSER_EMULATION registry key? I not, you are actually using IE7 engine in the WebBrowser control.
Try searching this forum for further explanations.
cheers,
</wqw>
Where I can update my register parameters? What I have to do?
Could you help me?
Thanks
-
May 4th, 2015, 09:18 AM
#8
Re: VB6 WebBrowser problem... a serious problem!
Olaf's project will be a lot better to use i guarantee.
If you want the registry key i gave you the link in Post #3 which i point out the registry key and Olaf gave a nice sample in that thread too check it out.
-
May 4th, 2015, 11:02 AM
#9
Re: VB6 WebBrowser problem... a serious problem!
It's a very nice map app. Any way to make the map move as you move the mouse (like scrolling)
Last edited by jmsrickland; May 4th, 2015 at 11:16 AM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
May 4th, 2015, 12:20 PM
#10
Thread Starter
Lively Member
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by Max187Boucher
Olaf's project will be a lot better to use i guarantee.
If you want the registry key i gave you the link in Post #3 which i point out the registry key and Olaf gave a nice sample in that thread too check it out.
I tried to do that.
I added (using the name of my app and the decimal number parameter 9000) a new entry here:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
I restarted my pc also... but nothing is changed.
-
May 4th, 2015, 01:54 PM
#11
Re: VB6 WebBrowser problem... a serious problem!
There is another key under Local_machine i think, have you tried changing useragent? I think it would be ideal to use Olaf's example the api will be 80% faster (if not more) with no errors or webbrowser limitation. The api is probably pretty easy to use and sinc Olaf provided an example you should be able to do exactly what you are doing with a webbrowser or IE and probably even more.
If we could see the project we could help fix it or at least the function you use to display the maps.
Even if we did fix it believe me the api will save you a lot of debugging and errors.
-
May 4th, 2015, 05:21 PM
#12
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by saturnus83
I tried to do that.
I added (using the name of my app and the decimal number parameter 9000) a new entry here:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
I restarted my pc also... but nothing is changed.
Is this happening w/ IE8 on an XP trying to emulate IE9?
Hope you can figure out what decimal you need for yourapp.exe value.
cheers,
</wqw>
-
May 4th, 2015, 05:46 PM
#13
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by jmsrickland
It's a very nice map app. Any way to make the map move as you move the mouse (like scrolling)
Did you try "normal Dragging" (holding the left mousekey down and then moving the map)?
Thought that this should work ... not with "live-updates of the view" currently (whilst dragging), but in the
MouseUp-Event the UserControl should navigate to the new coordinates (matching the Mouse-Distance).
It wouldn't be *that* difficult to implement a Live-View whilst dragging - but for that the approach
would need to be changed to a "tiled-one" (where one pre-downloads surrounding tiles, so that
the visualization of coord-changes can be smoother, blitted from already cached Tiles).
Olaf
-
May 5th, 2015, 02:33 AM
#14
Thread Starter
Lively Member
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by Schmidt
Did you try "normal Dragging" (holding the left mousekey down and then moving the map)?
Thought that this should work ... not with "live-updates of the view" currently (whilst dragging), but in the
MouseUp-Event the UserControl should navigate to the new coordinates (matching the Mouse-Distance).
It wouldn't be *that* difficult to implement a Live-View whilst dragging - but for that the approach
would need to be changed to a "tiled-one" (where one pre-downloads surrounding tiles, so that
the visualization of coord-changes can be smoother, blitted from already cached Tiles).
Olaf
Perfetct.
I nedd also to create route from one place to another. Can I do that with your app?
-
May 5th, 2015, 10:56 AM
#15
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by Schmidt
Did you try "normal Dragging" (holding the left mousekey down and then moving the map)?
Sure I did that but that only moves the map at end of 'drag' with mouseup
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
May 6th, 2015, 12:52 AM
#16
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by saturnus83
Perfetct.
I nedd also to create route from one place to another. Can I do that with your app?
I assume you're already aware, that for any additional stuff you want to draw "On-Top" of the current Map,
(as e.g. your own Markers or PolyLines) it is recommended to base those Drawings on Lat/Lng-Coords, to work properly.
E.g. when you have a "GPS-based Travel-Companion" like a "Garmin-Device" (or an appropriate
Application in your SmartPhone for that kind of stuff), and you import the GPS-Coords
from your last "Bicycle-ride" from it - then you will already have the right "Base-Format".
The Points I currently store in the "MapPoints-ListBox" of the small Demo, also already fulfill
that criterion - so (for convenience sake), I will use those Lat/Lng-Points in that ListBox for
my example below (to draw a PolyLine from the Coords in that List).
You will have to enhance the UserControl (a little bit) first, so that you'll be able to put your own
Drawings on Top of the current, "just refreshed Map-BackGround-Image".
Since you want to handle this stuff outside the Control (in your App) - it would be good to
introduce an appropriate Event into the UserControl, which is ideally raised at a Point,
where the BackGround-Image was just drawn onto the UserControl-Canvas.
And this point is here (the new Line of code marked magenta)
Code:
Private Sub UserControl_Paint()
SetStretchBltMode hDC, 4
StretchBlt hDC, 0, 0, ScaleWidth, ScaleHeight, BackBuf.hDC, 0, 0, BackBuf.Width, BackBuf.Height, vbSrcCopy
RaiseEvent PaintOnTopOfCanvas(hDC)
End Sub
Of course raising an Event from the UserControl needs the accompanying Event-Definition in the Declaration-Section of the Control:
(the new Line of code again marked magenta)
Code:
Event MouseMove(ByVal GMouseCoordLatLng As String)
Event MouseUp(ByVal GMouseCoordLatLng As String)
Event DblClick(ByVal GMouseCoordLatLng As String)
Event PaintOnTopOfCanvas(ByVal hDC As Long)
Other Additions which would be useful to place in the UserControl itself are a few (Public) Helper-Routines,
to ease the Lat/Lng-Coord-Conversion to Canvas-Pixels, as well as some Drawing-Settings:
(New code, e.g. place it at the end of the UserControl if you want):
Code:
Public Function LngToCanvasPxlX(Lng) As Long 'Longitude to current CanvasPixel-X (respecting the current Scaled-Size)
LngToCanvasPxlX = ((LngToPxlX(Lng) - LngToPxlX) / mSize + 0.5) * ScaleWidth
End Function
Public Function LatToCanvasPxlY(Lat) As Long 'Latitude to current CanvasPixel-Y (respecting the current Scaled-Size)
LatToCanvasPxlY = ((LatToPxlY(Lat) - LatToPxlY) / mSize + 0.5) * ScaleHeight
End Function
Public Sub SetLineWidthAndColor(LineWidth, Color) 'just some Settings for LineWidth and Color before GDI-calls are made outside
UserControl.ForeColor = Color
UserControl.DrawWidth = LineWidth
End Sub
That's it already with regards to changes and enhancements on the UserControl-Code,
the rest should be handled outside (in your App) - and it's up to you what you draw on Top of the current Map.
The following is just an example which simply connects the currently defined Marker-Positions in the Forms ListBox -
(...which doesn't make much sense probably - but it shows how to deal with "Lat,Lng-Coord-Lists", defined outside the Control)
Code:
Private Sub ucGMap1_PaintOnTopOfCanvas(ByVal hDC As Long)
Dim i As Long, strLatLng, Lat, Lng, PolyPoints() As Long
If lstMarkers.ListCount = 0 Then Exit Sub 'nothing to do here, in case the ListBox contains no Markers
'parse out the x,y Points (in Pixels) from the currently stored Lat-Lng-Strings in the Markers-ListBox
ReDim PolyPoints(0 To lstMarkers.ListCount * 2 - 1) 'ensure proper space in our PolyArray (2 times the listcount)
For i = 0 To lstMarkers.ListCount - 1
strLatLng = Mid$(lstMarkers.List(i), 3)
Lat = Val(Split(strLatLng, ",")(0))
Lng = Val(Split(strLatLng, ",")(1))
'convert and store the x,y-Pixel-Pairs in our Poly-Array now: (x at even, y at odd indexes)
PolyPoints(2 * i + 0) = ucGMap1.LngToCanvasPxlX(Lng) 'that's our new Helper-Routine for the Mapping to Canvas-Pixels
PolyPoints(2 * i + 1) = ucGMap1.LatToCanvasPxlY(Lat) '...dito here
Next
ucGMap1.SetLineWidthAndColor 3, vbBlue 'use the 3rd of our new Helper-Routines, to prepare for the following GDI-call
Polyline hDC, PolyPoints(0), (UBound(PolyPoints) + 1) \ 2
End Sub
The needed API-Declare to place in the Demo-Form is this one:
Code:
Private Declare Function Polyline& Lib "gdi32" (ByVal hDC&, Points As Any, ByVal nCount&)
Here's the Result (fully supporting all Zoom-Modes etc.)
Since it is using good old GDI, you have currently no Antialiasing and no Alpha-Support
on those PolyLines - but you could beautify all that by alternatively using GDI+ (or the vbRichClient)
for those Drawings (also for drawing your own, nicer Markers for example, instead of using the ones
provided by Google).
Olaf
Last edited by Schmidt; May 6th, 2015 at 02:35 AM.
-
May 6th, 2015, 06:05 AM
#17
Thread Starter
Lively Member
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by Schmidt
I assume you're already aware, that for any additional stuff you want to draw "On-Top" of the current Map,
(as e.g. your own Markers or PolyLines) it is recommended to base those Drawings on Lat/Lng-Coords, to work properly.
E.g. when you have a "GPS-based Travel-Companion" like a "Garmin-Device" (or an appropriate
Application in your SmartPhone for that kind of stuff), and you import the GPS-Coords
from your last "Bicycle-ride" from it - then you will already have the right "Base-Format".
You're very kind.
I want to tell you what I need, so you can help me best.
Who uses my app has a resturant, and he wants to send some food to the client's home.
So I have the address of both, but not the coordinates. My app should trace the route between them.
How can I do?
Thanks
-
May 6th, 2015, 11:38 AM
#18
Re: VB6 WebBrowser problem... a serious problem!
Sounds like what you get when you do a MapQuest from point A to point B
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
May 8th, 2015, 08:47 AM
#19
Thread Starter
Lively Member
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by Schmidt
I assume you're already aware, that for any additional stuff you want to draw "On-Top" of the current Map,
(as e.g. your own Markers or PolyLines) it is recommended to base those Drawings on Lat/Lng-Coords, to work properly.
E.g. when you have a "GPS-based Travel-Companion" like a "Garmin-Device" (or an appropriate
Application in your SmartPhone for that kind of stuff), and you import the GPS-Coords
from your last "Bicycle-ride" from it - then you will already have the right "Base-Format".
The Points I currently store in the "MapPoints-ListBox" of the small Demo, also already fulfill
that criterion - so (for convenience sake), I will use those Lat/Lng-Points in that ListBox for
my example below (to draw a PolyLine from the Coords in that List).
I can't use your control to trace a route between a source and a destination.
How can I?
Could you help me, please?
-
Jan 22nd, 2019, 04:39 AM
#20
Lively Member
Re: VB6 WebBrowser problem... a serious problem!
ucGMap ... does not work anymore. Posible google static api change?
-
Jan 22nd, 2019, 04:26 PM
#21
Re: VB6 WebBrowser problem... a serious problem!
Originally Posted by cliv
ucGMap ... does not work anymore . Posible google static api change?
No - it worked for a while longer (until mid last year or so), when an additional param was added to the URL:
&key=YourAPIKey
That URL-expanding auth-technique will now require an additional explicit "Static-Maps-Enabled switch" in your developer-account (or something like that).
I've not bothered to make it work further though, because they've changed the "billing-plan" as well.
Now, there's no "free quotas" anymore - every single request needs to be payed for now.
So for me, the story ended there...
(if I have need, I might adapt the Demo to work against OpenStreetMaps - but so far I don't have any such need -
maybe others will jump in here...)
Olaf
-
Jan 22nd, 2019, 05:26 PM
#22
Re: VB6 WebBrowser problem... a serious problem!
I get this response:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
<status>REQUEST_DENIED</status>
<error_message>You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account</error_message>
</GeocodeResponse>
The Google Maps Platform server rejected your request. You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account
( form 11 Jun 2018)
You must have a valid API key and a billing account to access our APIs. When you enable billing, you will get $200 free usage every month for Maps, Routes, or Places. Based on the millions of users using our APIs today, most of them can continue to use Google Maps Platform for free with this credit. Having a billing account helps us understand our developers’ needs better and allows you to scale seamlessly.
Last edited by reexre; Jan 22nd, 2019 at 05:32 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|