SetDefaultPrinter hangs application

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
spencermiles
Posts: 2
Joined: Wed Jul 27 2005

SetDefaultPrinter hangs application

Post by spencermiles »

We are having problems with SetDefaultPrinter hanging our application. If I look in the printers control panel, Amyuni PDF has been successfully set as the default printer, so I'm not sure why it is hanging. I have been unable to find any pattern for this, but it generally happens after we export a few documents in a session. Once this happens, the application process has to be killed, and it appears that Amyuni progresses into some terrible state where nothing will work. To continue, amyuni has to be uninstalled/reinstalled.

A snippet of code follows. You will notice debugging output that we have inserted to determine where the application is hanging.

strPrinterName = m_sys.XML.GetNodeValue(m_mnf.ManifestData, "Configuration/PrinterName")

WriteLog "ENTER", app.EXEName, TypeName(Me), "InstallPrinter (DriverInit)", icsETDebug
lngResult = m_cdi.DriverInit(strPrinterName)
Debug.Print "DriverInit " & CStr(lngResult)

' First time activation of printer
WriteLog "ENTER", app.EXEName, TypeName(Me), "InstallPrinter (EnablePrinter)", icsETDebug
m_cdi.EnablePrinter m_strCompany, m_strLicense

WriteLog "ENTER", app.EXEName, TypeName(Me), "InstallPrinter (SetDefaultPrinter)", icsETDebug
m_cdi.SetDefaultPrinter

WriteLog "ENTER", app.EXEName, TypeName(Me), "InstallPrinter (CaptureEvents)", icsETDebug
m_cdi.CaptureEvents True

WriteLog "ENTER", app.EXEName, TypeName(Me), "InstallPrinter (FileNameOptionsEx)", icsETDebug
m_cdi.FileNameOptionsEx = &H1 + &H2 + &H4 + &H20


Is this a known issue? This is absolutely critical, and if we cannot resolve this, we will need to switch to a different pdf converter component.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Setting the PDF Printer as default using SetDefaultPrinter is resources consuming but it shouldn't hang the application. It is advised however to call SetDefaultPrinter ONCE when launching your application and not each time you print.

The same application to the PDFDriverInit and DriverInit functions.

Hope this helps, if not please specify which version of the PDF Converter you are using.
Post Reply