Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printer DevMode Problem
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01321434
Message ID:
01323734
Views:
41
Hi

That is what I am beginning to believe also so now I need to find out how to change the Windows default printer.

Simon

>My guess is that your ActiveX control uses Windows default printer not VFP printer.
>
>>
>>Here is my modified test code for printing the RTF files. The printer settings are being set because I check them by looking at the VFP page setup dialog. However the ActiveX control ignores them. The ActiveX is supposed to use Windows print settings. So I assumed that when VFP sets the printer environment it is setting the Windows printer environment but perhaps not. When I open the page setup dialog using the ActiveX control it does not contain the same information as that of VFP.
>>
>>Regards,
>>Simon White
>>
>>
>>
>>*
>>* Test printing RTF files
>>*
>>LParameters tcFile
>>  Local lo
>>  lo=CreateObject("conGPEditor")
>>  lo.Open(tcFile)
>>   =SetPrinterDevMode(goApp.oPrintParam)
>>
>>*
>>* Print the document using the ActiveX control
>>* but it ignores the printer settings!!!!
>>*
>>  lo.Print(goApp.oPrintParam.Printer)
>>
>>*
>>* Now I open a document and print it from VFP9
>>* and it prints as expected.  If I check the
>>* page setup dialog it contains the proper settings
>>*
>>
>>  Modify Command test4
>>
>>Return
>>Procedure SetPrinterDevMode
>>   Lparameters toParam
>>   Local lcRpt,ln1,ln2,ln3,ln4,ln5,ln6
>>   lcRpt=Sys(2015)
>>   =PushWorkArea()
>>   Select 0
>>   Create Cursor Temp (Test C(10))
>>   Select 0
>>   Create Report (gcTmp+lcRpt+".frx") From Temp
>>   Use In Select("Temp")
>>   Use (gcTmp+lcRpt+".frx") Exclu Alias UPDevMod
>>   Set Printer to (toParam.Printer)
>>   Sys(1037,2)
>>   ln1=At("ORIENTATION",UPDevMod.Expr)
>>   ln2=At("PAPERSIZE",UPDevMod.Expr)
>>   Replace Next 1 UPDevMod.Expr With Stuff(UPDevMod.Expr,ln1,ln2-ln1,"ORIENTATION=1"+Chr(13)+Chr(10))
>>   ln2=At("PAPERSIZE",UPDevMod.Expr)
>>   ln3=At("ASCII",UPDevMod.Expr)
>>   Replace Next 1 UPDevMod.Expr With Stuff(UPDevMod.Expr,ln2,ln3-ln2,"PAPERSIZE="+Transform(GetPaperSize(toParam.PaperSize))+Chr(13)+Chr(10))
>>   ln4=At("COPIES",UPDevMod.Expr)
>>   ln5=At("DEFAULTSOURCE",UPDevMod.Expr)
>>   Replace Next 1 UPDevMod.Expr With Stuff(UPDevMod.Expr,ln4,ln5-ln4,"COPIES=2"+Chr(13)+Chr(10))
>>   If toParam.Tray<>"-1"
>>      ln5=At("DEFAULTSOURCE",UPDevMod.Expr)
>>      ln6=At("PRINTQUALITY",UPDevMod.Expr)
>>      Replace Next 1 UPDevMod.Expr With Stuff(UPDevMod.Expr,ln5,ln6-ln5,"DEFAULTSOURCE="+toParam.Tray+Chr(13)+Chr(10))
>>   EndIf
>>   Sys(1037,3)
>>   Use In Select("UPDevMod")
>>   =PopWorkArea()
>>
>>EndProc
>>
>>
>>
>>
Simon White
dCipher Computing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform