Visual Studio 2005 MFC Wizard Error

The Problem

I needed to research behavior of some low-level system API, so I decided to write a small GUI application in C++ using MFC. This was a first time after a long break. To my amazement, I discovered that there are troubles with Visual Studio MFC wizard.

I was trying to add a variable to a dialog by double-clicking on one of the controls (which happened to be a check box, but it does not really matter). On double-click I received the following JavaScript exception:

Object doesn't support this property or method

After that the wizard continuted to work (sort of). The "type" field in the wizard dialog was jammed, and the variable type came out as "undefined" in the code.

Jammed wizard

Hunting It Down

I traced this error down to a problem with the WizCombo ActiveX control that is used by the wizard:

ProgId = VsWizard.WizCombo.8.0, 
CLSID  = {d4d285dd-2447-11d7-8bf6-00b0d03daa06}

I put this control in an IE page by itself:

<html>
<body>
Text Before<br/>

<OBJECT ID="VariableType" CLASSID="CLSID:d4d285dd-2447-11d7-8bf6-00b0d03daa06" TABINDEX="2">
</OBJECT>

<br/>
Text after

<script language="jscript">
try
{
	alert("typeof(VariableType): " + typeof(VariableType));
	VariableType.Clear();
	window.alert("hoo");
}
catch (e)
{
	alert("Exception: " + e.message);
}
</script>

</body>
</html>

The page came up with a warning about disabled IE addons:

IE Page

The add-on manager had WizCombo control marked as disabled. Since the control was disabled, it was not possible to properly instantiate it on the wizard screen, or call its methods. This was the ulitmate source of the exception on double-click.

I could not enable the control, because of the group policy (see below).

The Solution

Add-on Manager

I have found an article in the News Groups about the subject:

http://groups.google.com/group/microsoft.public.vc.ide_general/msg/eee147023d93d016?hl=en&

Dave Calkins

I'm using Visual C++ 2005 and have added a dialog to my project. As usual,
I right-click the dialog and select "Add Class". When it tries to open the
Add Class dialog, it pops up a script error: "Line 814: Object doesn't
support this property or method". I tried using the MS Script debugger to
see what the problem was.
 
I found the solution. I had gone into IE6 and disabled a bunch of AddOns
recently. Specifically, I had disabled the WizCombo addon, which is listed
as an unverified AddOn from Microsoft. This WizCombo AddOn is necessary for
studio's Add Class wizard dialog. I had a warning about a spyware addon and
had disabled that and thought it best to disable the WizCombo as well since
it was listed as unverified. Well, this was a bad move because, despite it
being unverified, studio needs it.

Windows group policy allows to restrict loaded ActiveX controls to a specific list (see http://support.microsoft.com/kb/883256).

A list of the allowed add-ons is kept here: /p>

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID

and in a similar key in the HKEY_LOCAL_MACHINE.

If you have enough rights to write to this key, it is possible to manually add

REG_SZ {d4d285dd-2447-11d7-8bf6-00b0d03daa06} = "2"

which will enable the WizCombo add-on.