CHtmlView Windows 7 issue
-
You need to use the extra options (
dwFlags
andlpszTargetFrameName
) in theNavigate2()
[^] call, as described here[^].Unrequited desire is character building. OriginalGriff
Thanks for your suggestions but I don't get it working. I've tried with all of the TargetFrameNames ("_self", "_top", "_parent") - no effect. For the BrowserNavConstants therer are several flags to open the file in a new window, tab ... but no one that prevents a new window explicitly. Another strange observation: when trying to open a URL (http://www.google.de/) it wont't show the rendered site but the source of the site in notepad.
-
Thanks for your suggestions but I don't get it working. I've tried with all of the TargetFrameNames ("_self", "_top", "_parent") - no effect. For the BrowserNavConstants therer are several flags to open the file in a new window, tab ... but no one that prevents a new window explicitly. Another strange observation: when trying to open a URL (http://www.google.de/) it wont't show the rendered site but the source of the site in notepad.
Sorry but I cannot suggest anything further if the Microsoft code does not work. Unfortunately I don't have MFC so can't try reproducing the problem.
Unrequited desire is character building. OriginalGriff
-
Hello, I have a (maybe small) problem that is driving me mad. I am using a CHtmlView derived class to display a html file that is stored locally on the PC. I'm using Navigate2() for that. On Windows XP machines everything works fine but Windows 7 always opens a new IExplorer window instead of displaying the file in my view. I tried to override OnNewWindow2() but the according event does not occur. I use the following code in the OnInitialUpdate() function of the view:
CString fileName = theApp.m_sSettingsPath + CString("Certificate\\certificate.htm");
Navigate2(fileName);I've also tried the "file://" syntax, but same behaviour. Thank's for your help, Ralf
- how about Navigate2("http://www.xxx.com"...)? 2) try OnNewWindow3 please.
-
- how about Navigate2("http://www.xxx.com"...)? 2) try OnNewWindow3 please.
Thanks for your help, but still no luck. Implemented a handler for the NewWindow3 event but it seems that the event is not fired. Tried with Navigate2("http://www.codeproject.com") but same behaviour (source code shown in notepad). When trying to open local file it is downloaded to temporary internet files and then opened in IE.
-
Thanks for your help, but still no luck. Implemented a handler for the NewWindow3 event but it seems that the event is not fired. Tried with Navigate2("http://www.codeproject.com") but same behaviour (source code shown in notepad). When trying to open local file it is downloaded to temporary internet files and then opened in IE.
The behavior sounds like that the Win7 default shell operation not correctly set. Can you check the registry for the default value of HKEY_CLASSES_ROOT\htmlfile\shell [HKEY_CLASSES_ROOT\htmlfile\shell] @="opennew" or you can try on another Win7 machine?
-
The behavior sounds like that the Win7 default shell operation not correctly set. Can you check the registry for the default value of HKEY_CLASSES_ROOT\htmlfile\shell [HKEY_CLASSES_ROOT\htmlfile\shell] @="opennew" or you can try on another Win7 machine?
Thanks again. Checked the registry value: was OK. Checked on another Win7 system: same behaviour. Created a new blank SDI-App with a CHtmlView derived View. Same code like in my original app:
CHtmlViewTest::OnInitialUpdate()
{
CHtmlView::OnInitialUpdate();
Navigate2(_T("http://www.codeproject.com"));
}The source code of the page is opened in notepad. If I use a local html file, it is displayed correctly.
-
Hello, I have a (maybe small) problem that is driving me mad. I am using a CHtmlView derived class to display a html file that is stored locally on the PC. I'm using Navigate2() for that. On Windows XP machines everything works fine but Windows 7 always opens a new IExplorer window instead of displaying the file in my view. I tried to override OnNewWindow2() but the according event does not occur. I use the following code in the OnInitialUpdate() function of the view:
CString fileName = theApp.m_sSettingsPath + CString("Certificate\\certificate.htm");
Navigate2(fileName);I've also tried the "file://" syntax, but same behaviour. Thank's for your help, Ralf
-
Thanks for your suggestions but I don't get it working. I've tried with all of the TargetFrameNames ("_self", "_top", "_parent") - no effect. For the BrowserNavConstants therer are several flags to open the file in a new window, tab ... but no one that prevents a new window explicitly. Another strange observation: when trying to open a URL (http://www.google.de/) it wont't show the rendered site but the source of the site in notepad.
-
Thanks again. Checked the registry value: was OK. Checked on another Win7 system: same behaviour. Created a new blank SDI-App with a CHtmlView derived View. Same code like in my original app:
CHtmlViewTest::OnInitialUpdate()
{
CHtmlView::OnInitialUpdate();
Navigate2(_T("http://www.codeproject.com"));
}The source code of the page is opened in notepad. If I use a local html file, it is displayed correctly.
It's really very strange... Because CHtmlView::Navigate2 just a wrapper of IWebBrowser2::Navigate2 Maybe you need to step into the Navigate2 call. or just call IWebBrowser2::Navigate2 directly and see what will happened. Unfortunately I does not have Win7 on hand. So, can not help you more.
-
It's really very strange... Because CHtmlView::Navigate2 just a wrapper of IWebBrowser2::Navigate2 Maybe you need to step into the Navigate2 call. or just call IWebBrowser2::Navigate2 directly and see what will happened. Unfortunately I does not have Win7 on hand. So, can not help you more.
I've just tried to call Navigate2 in the CHtmlView and the IWebBrowser2 with all the same behavior. I come to think that it might be some user permissions thing on Windows 7. Maybe my app is not allowed to open websites? Does anyone know which permissions have to be granted? I've checked the I[Internet Explorer\Main\FEATURE_...] stuff but did not find something appropriate. I had a look on the process creation and following happened: After my Navigate2 call an iexplore process was created and this one created another iexplore process that then showed my page.
modified on Thursday, August 25, 2011 3:16 AM
-
Member 8109560 wrote:
I've tried with all of the TargetFrameNames ("_self", "_top", "_parent") - no effect
Also tried with your window name, or only the cited predefined strings ?
How do I get my window name? Is it the one in the title bar?
-
How do I get my window name? Is it the one in the title bar?
-
Member 8109560 wrote:
Is it the one in the title bar
Not necessarily; you can find it out using Spy++, or programmatically with, for instance:Get a handle on your window and use GetWindowText().
Same behavior when specifying my window as target. X|