I've been converting our application from using CHtmlView over to WebView2. Our application has a web-based start page that generally gets all its information from our servers, but we have local resources setup in the event of our servers being down or the client having internet trouble. Using CHtmlView we were able to navigate to an html page in the embedded resources like so:
HINSTANCE hInstance = AfxGetResourceHandle();
ASSERT(hInstance != NULL);
TCHAR lpszModule[_MAX_PATH];
if (GetModuleFileName(hInstance, lpszModule, _MAX_PATH))
{
CString strResourceURL;
strResourceURL.Format(_T("res://%s/%d"), lpszModule, IDR_STARTPAGE);
Navigate2(strResourceURL, NULL,NULL);
}
This would load the page and the images that where also embedded as resources.
WebView2 Navigate doesn't seem to support this same method since passing the same string only gives a blank page.
I was able to load the page into a CString via LoadResource and then pass that on to NavigateToString. That loads the page fine, but none of the images show up. Is there any way to get to the embedded images with WebView2?