2017-07-14 8 views
2

私たちは大規模なシステムをVB6で作成しました。システムの一部はWebControlを使用してユーザーにBINGマップを提示します。これはBING webcontrolのV7を使用しています。マイクロソフトではV7コントロールを廃止しましたので、V8に移行しようとしていますが、いくつか問題があります。VB6 IDEからBING Webcontrol V8を使用する

Bing WebControl V8にはIE11が必要です(ただしIE10では機能します)が、WebControlではデフォルトでIE7レンダリングエンジンのみが使用されます。あなたは、レジストリキーを書き込むことによって、後にエンジンを(利用可能な場合)を使用して、それを伝えることができます。

プログラムがコンパイルされたときに正常に動作しますが、VB6のIDEから実行しているときは動作しませんので、デバッグがある
HKCU\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\<exe name> REG_DWORD 11000 

ピタコンパイルされたEXE名とVB6.EXEの両方をレジストリに設定しましたが、VB6では動作しません。

WebControlでIDE内でIE10/11レンダリングを使用する方法については、どのような考えですか?これはWindows 7 btwです。 は、フォームにWebBrowserコントロールを追加MSIEそれを呼び出す:

EDIT

は、ここに私のコードです。

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 
+0

[OK]を、私は週末の後にこれに戻って何らかの理由で、それはうまく動作します。私が考えることのできるものは何も変わっていません。 – Slugsie

答えて

0

あなたのHTMLページのヘッダーに以下を追加します。

<meta http-equiv="x-ua-compatible" content="IE=Edge"/>

これがマシンにインストールIEの最新バージョンを使用するようにWebコントロールを教えてくれます。

+0

私はすでにこれを試していますが、VB6 IDEで実行しても違いはありません。 – Slugsie

+0

その後、https://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Versionに記載されているようにレジストリを編集するか、別のウェブブラウザコントロールでは、VB6で動作するChromiumのバージョンが存在する可能性があります。 – rbrundritt

+0

私が元の質問に述べたように、私は既にそのレジストリエントリを試しました。コンパイルされたEXEでは動作しますが、IDE内でデバッグを実行している間は動作しません。 – Slugsie

関連する問題