使用VB6 IDE中的BING Webcontrol V8

使用VB6 IDE中的BING Webcontrol V8,vb6,bing-maps,Vb6,Bing Maps,我们有一个用VB6编写的大型系统,系统的一部分使用网络控件向用户展示BING地图。这是使用BING网络控制的V7。微软已经弃用了V7控件,所以我正在尝试迁移到V8,但我遇到了一些问题 Bing WebControl V8需要IE11(尽管它在IE10上工作),但默认情况下WebControl仅使用IE7渲染引擎。您可以通过写入注册表项告诉它使用更高版本的引擎(如果可用): HKCU\Software\Microsoft\Internet Explorer\Main\FeatureControl\

我们有一个用VB6编写的大型系统,系统的一部分使用网络控件向用户展示BING地图。这是使用BING网络控制的V7。微软已经弃用了V7控件,所以我正在尝试迁移到V8,但我遇到了一些问题

Bing WebControl V8需要IE11(尽管它在IE10上工作),但默认情况下WebControl仅使用IE7渲染引擎。您可以通过写入注册表项告诉它使用更高版本的引擎(如果可用):

HKCU\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\<exe name> REG_DWORD 11000
HKCU\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE\u BROWSER\u EMULATION\REG\u DWORD 11000
这在编译程序时可以正常工作,但在从VB6 IDE运行时不起作用,因此调试是一个PITA。我已经在注册表中设置了编译的EXE名称和VB6.EXE,但它在VB6中不起作用

关于如何让WebControl在IDE中运行时使用IE10/11渲染,有什么想法吗?这是在Windows7上

编辑

这是我的密码: 将WebBrowser控件添加到窗体,称之为msIE

    Option Explicit

Private mstrHTTP As String
Public mstrAPI_Key As String

Private Sub Form_Load()
    Me.Caption = "Name : '" & App.EXEName & "'"

    mstrHTTP = ""
    mstrAPI_Key = "Your BING API key here"

    msIE.Navigate ("about:blank")

    Call BuildFunction(mstrHTTP, "<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">")
    Call BuildFunction(mstrHTTP, "<html>")
    Call BuildFunction(mstrHTTP, "    <head>")
    Call BuildFunction(mstrHTTP, "        <meta http-equiv='X-UA-Compatible' content='IE=Edge' />")
    Call BuildFunction(mstrHTTP, "        <title>Load map with navigation bar module</title>")
    Call BuildFunction(mstrHTTP, "        <meta charset='utf-8' />")
    Call BuildFunction(mstrHTTP, "        ")
    Call BuildFunction(mstrHTTP, "        <!-- Reference to the Bing Maps SDK -->")
    Call BuildFunction(mstrHTTP, "        <script type='text/javascript'")
    Call BuildFunction(mstrHTTP, "                src='http://www.bing.com/api/maps/mapcontrol?callback=GetMap'")
    Call BuildFunction(mstrHTTP, "                async defer></script>")
    Call BuildFunction(mstrHTTP, "        ")
    Call BuildFunction(mstrHTTP, "        <script type='text/javascript'>")
    Call BuildFunction(mstrHTTP, "        function GetMap()")
    Call BuildFunction(mstrHTTP, "        {")
    Call BuildFunction(mstrHTTP, "            var map = new Microsoft.Maps.Map('#myMap', {")
    Call BuildFunction(mstrHTTP, "                credentials: '" & mstrAPI_Key & "'")
    Call BuildFunction(mstrHTTP, "                ,enableInertia: false")
    Call BuildFunction(mstrHTTP, "                ,showMapTypeSelector: false")
    Call BuildFunction(mstrHTTP, "                ,showZoomButtons: false")
    Call BuildFunction(mstrHTTP, "                ,showLocateMeButton: false")
    Call BuildFunction(mstrHTTP, "            });")
    Call BuildFunction(mstrHTTP, "        // Add post map load code here")
    Call BuildFunction(mstrHTTP, "        }")
    Call BuildFunction(mstrHTTP, "        </script>")
    Call BuildFunction(mstrHTTP, "    </head>")
    Call BuildFunction(mstrHTTP, "    <body style='margin:0;'>")
    Call BuildFunction(mstrHTTP, "        <div id='myMap' style='width:100%;height:100%;'></div>")
    Call BuildFunction(mstrHTTP, "    </body>")
    Call BuildFunction(mstrHTTP, "</html>")

    msIE.Document.write (mstrHTTP)

End Sub

Private Sub BuildFunction(ByRef theString As String, ByRef extraString As String)
    theString = theString & extraString & vbCrLf
End Sub

Private Sub Form_Resize()
    msIE.Top = 0
    msIE.Left = 0
    msIE.Width = Me.ScaleWidth
    msIE.Height = Me.ScaleHeight
End Sub
选项显式
私有mstrHTTP As字符串
公共mstrAPI_键作为字符串
专用子表单_加载()
Me.Caption=“Name:”&App.EXEName&“
mstrHTTP=“”
mstrAPI_Key=“此处是您的BING API密钥”
msIE.Navigate(“关于:空白”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“加载带有导航条模块的地图”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“函数GetMap()”)
调用BuildFunction(mstrHTTP,“{”)
调用BuildFunction(mstrHTTP,“var map=new Microsoft.Maps.map('#myMap',{”)
调用BuildFunction(mstrHTTP,“凭据:”&mstrAPI_Key&“”)
调用BuildFunction(mstrHTTP,“,enableInertia:false”)
调用BuildFunction(mstrHTTP,“,showMapTypeSelector:false”)
调用BuildFunction(mstrHTTP,“,showZoomButtons:false”)
调用BuildFunction(mstrHTTP,“,showLocateMeButton:false”)
调用BuildFunction(mstrHTTP,“};”)
调用BuildFunction(mstrHTTP,“//在此处添加后期映射加载代码”)
调用BuildFunction(mstrHTTP,“}”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
调用BuildFunction(mstrHTTP,“”)
msIE.Document.write(mstrHTTP)
端接头
私有子构建函数(ByRef theString作为字符串,ByRef extraString作为字符串)
字符串=字符串和外字符串以及vbCrLf
端接头
私有子表单_Resize()
msIE.Top=0
msIE.Left=0
msIE.Width=Me.ScaleWidth
msIE.Height=Me.ScaleHeight
端接头

将以下内容添加到HTML页面的标题中:


这将告诉Web控件使用计算机上安装的最新版本的IE。

我已经尝试过了,在VB6 IDE中运行时没有任何区别。然后您必须按照此处所述编辑注册表或使用其他Web浏览器控件,可能有一个版本的Chromium可以在VB6上运行。正如我在原始问题中所说的,我已经尝试过该注册表项。它适用于已编译的EXE,但在IDE内的调试中运行时不起作用。好的,出于某种原因,我在周末后又回到了这个问题,它工作得很好。我想不出有什么变化,只是现在起作用了。