locked
Common Font Dialog (comdlg32.ocx) not working on Windows 7 RRS feed

  • Question

  • I have an app written as an HTA with several ActiveX controls running as a 32-bit process on Windows 7, Vista, and XP (and earlier). It all now works except the Font dialog. The font object is null when referenced on a fresh install of Windows 7 or with KB974431 update installed.

    It does work normally on Win7 when I have Visual Studio (2008) installed. I have a common dialog lpk license file and file manager and common dialog objects in my hta main page. The activex ocx files for comctl32.ocx, comdlg32.ocx, and mxcomctl.ocx are registered in sysWOW64 or system32. It behaves the same on either 64 or 32 bit Windows 7.

    What am I missing? Why is the font dialog object not created?

    John Hedges

     


    APH Educational Talking Software
    Friday, September 24, 2010 4:20 PM

All replies

  • I have the same problem.

    On my win 7 I have VS 2010 installed (I didn't try font dialog when I had VS 2008).

    I tried the font dialog in VB6 with a form app and it could launch font dialog, but when I tried to do the same in javascript, it failed with exception:

     Could not complete the operation due to error 800a8000

    at line calling ShowFont().

    Here is my html code:

    <html>
    <head>
    <title>test</title>
    </head>

    <script>

    function doclick() {
            var fontDlg = document.all.fontDlg
      //var fontDlg = new ActiveXObject("MSComDlg.CommonDialog");

      /*
            cdlCCRGBInit = 1;
            cdlCCFullOpen = 2;
            cdlCCPreventFullOpen = 4;

            fontDlg.Flags = (cdlCCRGBInit | cdlCCFullOpen | cdlCCPreventFullOpen);
            fontDlg.CancelError = false;
            fontDlg.Min = 8;
            fontDlg.Max = 72;
            fontDlg.DialogTitle = "Change font settings";
            fontDlg.ShowFont();
            //fontDlg.ShowColor();
      */
      fontDlg.ShowFont();
    }

    </script>
    <body>

    <input type=button onclick=doclick() value="click me"/>

        <OBJECT id="fontDlg" style="LEFT: 224px; POSITION: absolute; TOP: 24px" classid="clsid:F9043C85-F6F2-101A-A3C9-08002B2F49FB" CODEBASE="http://activex.microsoft.com/controls/vb5/comdlg32.cab #Version=1,0,0,0">
            <PARAM NAME="_ExtentX" VALUE="847">
            <PARAM NAME="_ExtentY" VALUE="847">
            <PARAM NAME="_Version" VALUE="393216">
            <PARAM NAME="CancelError" VALUE="0">
            <PARAM NAME="Color" VALUE="0">
            <PARAM NAME="Copies" VALUE="1">
            <PARAM NAME="DefaultExt" VALUE="">
            <PARAM NAME="DialogTitle" VALUE="">
            <PARAM NAME="FileName" VALUE="">
            <PARAM NAME="Filter" VALUE="">
            <PARAM NAME="FilterIndex" VALUE="0">
            <PARAM NAME="Flags" VALUE="0">
            <PARAM NAME="FontBold" VALUE="$!form.bean.fontBold">
            <PARAM NAME="FontItalic" VALUE="$!form.bean.fontItalic">
            <PARAM NAME="FontName" VALUE="$!form.bean.fontName">
            <PARAM NAME="FontSize" VALUE="$!form.bean.fontSize">
            <PARAM NAME="FontStrikeThru" VALUE="0">
            <PARAM NAME="FontUnderLine" VALUE="0">
            <PARAM NAME="FromPage" VALUE="0">
            <PARAM NAME="HelpCommand" VALUE="0">
            <PARAM NAME="HelpContext" VALUE="0">
            <PARAM NAME="HelpFile" VALUE="">
            <PARAM NAME="HelpKey" VALUE="">
            <PARAM NAME="InitDir" VALUE="">
            <PARAM NAME="Max" VALUE="0">
            <PARAM NAME="Min" VALUE="0">
            <PARAM NAME="MaxFileSize" VALUE="260">
            <PARAM NAME="PrinterDefault" VALUE="1">
            <PARAM NAME="ToPage" VALUE="0">
            <PARAM NAME="Orientation" VALUE="1">
        </OBJECT>
    </body>
    </html>

    Saturday, December 18, 2010 1:05 PM