Microsoft KB Archive/299955

= FIX: Using SET('PRINTER) in COM Server Causes Error =

Article ID: 299955

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q299955



SYMPTOMS
If you use SET('PRINTER',2) or SET('PRINTER,3) in a Component Object Model (COM) server, you may receive an error message that resembles the following:

OLE IDispatch exception code 1031...

User-interface not allowed at this time.



STATUS
This problem was corrected in Visual FoxPro version 7.0 for Windows.



Steps to Reproduce Behavior
  In Visual FoxPro (VFP) 6.0, paste the following code in a new program: *!* Q299955 *!* Q299955 LOCAL lcVar
 * 1) DEFINE CRLF CHR(13) + CHR(10)

CREATE PROJECT PrnTest NOWAIT

lcVar = &quot;DEFINE CLASS PrnTest AS CUSTOM OLEPUBLIC&quot; + CRLF + ; &quot;  PROCEDURE ShowProblem&quot; + CRLF + ; &quot;        LOCAL lcPrinter&quot; + CRLF + ; &quot;        SYS(2335,0)&quot; + CRLF + ; &quot;        lcPrinter = SET('PRINTER', 2)&quot;  + CRLF + ; &quot;  ENDPROC&quot; + CRLF + ; &quot;ENDDEFINE&quot;

=STRTOFILE(lcVar, 'PrnTest.prg', .F.) _VFP.ACTIVEPROJECT.FILES.ADD('PrnTest.prg') _VFP.ACTIVEPROJECT.BUILD('PrnTest.dll', 4)  Save and run the program (the name is unimportant).  Type the following commands in the Command window: x = CREATEOBJECT(&quot;PrnTest.PrnTest&quot;) x.ShowProblem 

Keywords: kbbug kbfix kbcodesnippet kbvfp700fix KB299955

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.