Loads a web page or local HTML file from a URL into an HTMLView control.
Takes htmlViewID (Int) and url (String).
Returns nothing.
BGI GUI
Parameters & Returns
Parameters
htmlViewIDInt
urlString
Returns
Void
Quick Summary
Loads a web page or local HTML file from a URL into an HTMLView control.
Takes htmlViewID (Int) and url (String).
Returns nothing.
Technical Exegesis...
Loads a web page or local HTML file from a URL into an HTMLView control. Searches webBrowserMap for htmlViewID. If found, gets IWebBrowser2* interface. Converts UTF-8 url string to wide character (wchar_t*) using MultiByteToWideChar with CP_UTF8. Allocates VARIANT for URL parameter. Calls pBrowser->Navigate(wideUrl, &vFlags, &vTargetFrameName, &vPostData, &vHeaders) with URL variant. VariantClear releases variant. Frees allocated wide string. No return value.
Loads a web page or local HTML file from a URL into an HTMLView control. Searches webBrowserMap for htmlViewID. If found, gets IWebBrowser2* interface. Converts UTF-8 url string to wide character (wchar_t*) using MultiByteToWideChar with CP_UTF8. Allocates VARIANT for URL parameter. Calls pBrowser->Navigate(wideUrl, &vFlags, &vTargetFrameName, &vPostData, &vHeaders) with URL variant. VariantClear releases variant. Frees allocated wide string. No return value.
This function navigates the WebBrowser control to a specified URL (web or file). Supports http://, https://, file:/// protocols. UTF-8 to wide char conversion handles international domain names and paths. Navigate() is asynchronous - function returns before page loads. Navigation triggers standard browser events (BeforeNavigate2, DocumentComplete). For local files, use file:/// protocol: "file:///C:/path/to/page.html". Relative paths not supported - must use absolute paths or full URLs. Navigation history is maintained - accessible via bgiHTMLGoBack/Forward. Failed navigation (404, DNS error) may show IE error page or remain on current page. Use bgiGetHTMLURL to verify successful navigation. JavaScript, CSS, images load automatically if accessible. Cross-origin restrictions apply for local files accessing web resources.