Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have been experiencing exactly the same problem, but it only occurs on certain machines. I managed to recreate the problem with the following steps:</p> <ol> <li>Using Microsoft Virtual PC 2007, install a clean build of XP Pro.</li> <li>Without installing anything else, other than the VM Addons, apply all of the MS Updates.</li> <li>Run the code as described above. I have provided an alternative below too.</li> </ol> <p>It would seem that the problem has occurred through an MS update. Using the KB240797 knowledge base article (<a href="http://support.microsoft.com/default.aspx/kb/240797?p=1" rel="nofollow noreferrer">http://support.microsoft.com/default.aspx/kb/240797?p=1</a>), I was able to determine that a kill bit had been issued for the Common Dialog ActiveX control, and an alternative class ID provided (8F0F480A-4366-4737-8265-2AD6FDAC8C31), suggesting that the control had been superseded. However, after checking other machines on which the control worked, specifically development machines (XP Pro x64, XP Pro x32 &amp; Vista x32), each with a copy of Visual Studio 2008 installed, there was no kill bit entry nor was there an alternative class ID.</p> <p>To get the dialog working, I simply renamed the registry key (I could have deleted it as well), meaning that there was no longer a kill bit. Hey presto, it worked!</p> <p>The registry key is:</p> <blockquote> <p>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ActiveX Compatibility{F9043C85-F6F2-101A-A3C9-08002B2F49FB}</p> </blockquote> <p>I guess that there is a chance that this will be re-applied with a future Microsoft cumulative update, and it may also open up some security vulnerability.</p> <p>I hope that that helps you. Thanks for your original post as it seems to have set me on the right track.</p> <p>Kaine</p> <pre><code> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;Common Dialog Test&lt;/title&gt; &lt;script language="vbscript" type="text/vbscript"&gt; Sub AlertErr() On Error Resume Next document.objComDlg.Copies = 1 document.objComDlg.FromPage = 1 document.objComDlg.ToPage = 1 document.objComDlg.Min = 1 document.objComDlg.Max = 1 document.objComDlg.Flags = cdlPDHidePrintToFile Or cdlPDNoSelection document.objComDlg.CancelError = True printerDialog = document.objComDlg.ShowPrinter If Err.Number = 0 Then Call MsgBox("No Error. The print simulation worked as expected.") ElseIf Err.Number = 32755 Then Call MsgBox("You clicked the 'Cancel' button.") Else Call MsgBox("The following error occurred: " &amp; Err.Description &amp; " (" &amp; Err.Number &amp; ")") End If End Sub &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt; &lt;button id="btnAlertErr" onclick="AlertErr()"&gt;Print Me&lt;/button&gt; &lt;object classid="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"&gt; &lt;param name="LPKPath" value="CommonDialog.lpk"&gt; &lt;/object&gt; &lt;object id="objComDlg" codebase="http://activex.microsoft.com/controls/vb6/comdlg32.cab" classid="clsid:F9043C85-F6F2-101A-A3C9-08002B2F49FB" viewastext&gt; &lt;param name="_ExtentX" value="847" /&gt; &lt;param name="_ExtentY" value="847" /&gt; &lt;param name="_Version" value="393216" /&gt; &lt;param name="_Version" value="393216" /&gt; &lt;param name="CancelError" value="0" /&gt; &lt;param name="Color" value="0" /&gt; &lt;param name="Copies" value="1" /&gt; &lt;param name="DefaultExt" value="" /&gt; &lt;param name="DialogTitle" value="" /&gt; &lt;param name="FileName" value="" /&gt; &lt;param name="Filter" value="" /&gt; &lt;param name="FilterIndex" value="0" /&gt; &lt;param name="Flags" value="0" /&gt; &lt;param name="FontBold" value="0" /&gt; &lt;param name="FontItalic" value="0" /&gt; &lt;param name="FontName" value="" /&gt; &lt;param name="FontSize" value="8" /&gt; &lt;param name="FontStrikeThru" value="0" /&gt; &lt;param name="FontUnderLine" value="0" /&gt; &lt;param name="FromPage" value="0" /&gt; &lt;param name="HelpCommand" value="0" /&gt; &lt;param name="HelpContext" value="0" /&gt; &lt;param name="HelpFile" value="" /&gt; &lt;param name="HelpKey" value="" /&gt; &lt;param name="InitDir" value="" /&gt; &lt;param name="Max" value="0" /&gt; &lt;param name="Min" value="0" /&gt; &lt;param name="MaxFileSize" value="260" /&gt; &lt;param name="PrinterDefault" value="1" /&gt; &lt;param name="ToPage" value="0" /&gt; &lt;param name="Orientation" value="1" /&gt; &lt;/object&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload