Help and Support

BUG: Cannot Force WebBrowser Control to Be Offline Using DLCTL_FORCEOFFLINE

Article ID:247336
Last Review:May 12, 2003
Revision:2.0
This article was previously published under Q247336
On This Page

SYMPTOMS

When you sink events for ambient properties, if you check for DISPID_AMBIENT_DLCONTROL and set the value to be returned to DLCTL_FORCEOFFLINE, the WebBrowser control does not behave as expected. Instead of going to the cache for all navigations, it still connects to the appropriate Internet server.

Back to the top

CAUSE

Although the DLCTL_FORCEOFFLINE is passed through to the WebBrowser control when the navigation occurs, it stills checks for an Internet connection and connects to the Internet if the connection is available.

Back to the top

RESOLUTION

There are no known workarounds.

Back to the top

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

Back to the top

MORE INFORMATION

Steps to Reproduce Behavior

1.Start Microsoft Visual C++ 6.0.
2.Create a new MFC AppWizard(exe) project.
3.Type a project name in the Project name edit box, and then click OK.
4.Select Single Document, and then click Next.
5.Choose the defaults on the rest of the screens in the MFC Appwizard except the last, in step 6.
6.At the last screen, select the View class and change the Base class found on the lower left to CHtmlView.
7.Click Finish.
8.Open the .cpp file for your view class and include the following header file:
#include <mshtmdid.h>
9.Invoke the ClassWizard by pressing CTRL+W.
10.Under Class name, find the View class.
11.Scroll through the messages until you find OnAmbientProperty. Click Add Function and then click Edit Code.
12.Add the following code to the OnAmbientProperty member function and save the file:
if (dispid == DISPID_AMBIENT_DLCONTROL)
{
	pvar->vt = VT_I4;
	pvar->lVal |= DLCTL_FORCEOFFLINE;
	return TRUE;
}
					
13.Go to Internet Options in Internet Explorer. (This is on the View menu for Internet Explorer 4.x versions and on the Tools menu for Internet Explorer 5.)
14.In the Internet Options dialog box, click Delete Files under Temporary Internet Files, and then close the dialog box.
15.Now compile and run your Visual C++ project. The browser will navigate to the Web page even if it is not located in the cache.

Back to the top


APPLIES TO
Microsoft Internet Explorer 4.0 128-Bit Edition
Microsoft Internet Explorer 4.01 Service Pack 2
Microsoft Internet Explorer 4.01 Service Pack 1
Microsoft Internet Explorer 5.0
Microsoft Internet Explorer 5.01
Microsoft Internet Explorer 5.5

Back to the top

Keywords: 
kbbug kbpending kbwebbrowser KB247336

Back to the top

Article Translations

 

Other Support Options

  • Contact Microsoft
    Phone Numbers, Support Options and Pricing, Online Help, and more.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.