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.
SetDefaultPrinter hangs application
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.
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.