I´m so happy i found this newsgroup, cause i hope you guys can help me

I´ve developed long time ago an Application which processes XML Files, and prints them with amyuni 2.10 to PDF Files. My Source for the printing to amyuni looks this:
Code: Select all
HDC hDC = CreateDC(_T("WINSPOOL"), m_szPDFPrinter, NULL, NULL);
if(NULL == hDC)
{
m_strLastError.Format(_T("Device-Context von WINSPOOL mit dem PDF-Drucker '%s' ist nicht gültig."), m_szPDFPrinter);
return false;
}
DOCINFO di;
memset(&di, 0, sizeof(di));
di.cbSize = sizeof(DOCINFO);
di.lpszDocName = _T("Bericht");
di.lpszOutput = m_strOutputPath + m_strOutputFile;
int nStartDoc = ::StartDoc(hDC, &di);
if(nStartDoc <= 0)
{
m_strLastError.Format(_T("Fehler in ::StartDoc(hDC, &di)\nFehlercode: %d\nStartDoc Return: %d"), ::GetLastError(), nStartDoc);
::EndDoc(hDC);
return false;
}
After this Problem, there is a PDF File with 0kb and the amyuni printer has a print job. Both, the PDF File and the printjob, can´t be deleted. We have to restart our server and then we can delete them.
We can´t reproduce this Problem, it just happens about 1 time a day (application runs the hole day and makes about 500 prints). It´s a really confusing problem

Thanks in advance
Tom