I noticed something weird with this process, it stays open even after I stop using the printer (And even using the RemoveOrphanPriners function leaves it open).
The problem is that I have a windows service using the API and it doesn't work.
My code, essentially does the following:
Dim objFactory As New PXCComLib.CPXCControlEx()
Dim objPrint As PXCComLib.CPXCPrinter = DirectCast(objFactory.Printer("", "MyPrinter", "", ""), PXCComLib.CPXCPrinter)
objFactory.RemoveOrphanPrinters("", "MyPrinter")
If I run these lines REPEATEDLY inside a regular application (Windows Forms application for example) it's OK.
In my win service however, this works once. If I try to restart the service then it gets stuck in the line:
Dim objFactory As New PXCComLib.CPXCControlEx()
And after a while I get the following exception:
System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {217974DB-6777-4A9F-90A7-AA5EBA834BA2} failed due to the following error: 80080005
So I can't start the service again for a while (I did not notice how much time), but if I manually kill the pdfSaver4 process then everything goes back to normal.
Any comments on that?
pdfSaver4 not disposedof correctly inside a service
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
-
- User
- Posts: 98
- Joined: Tue Feb 17, 2009 12:08 pm
-
- Site Admin
- Posts: 3550
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: pdfSaver4 not disposedof correctly inside a service
Looks like for some reasons pdfSaver4 cannot create new CPXCControlEx instance. For now I don't know why.
Can you send me sample service application for testing ?
Can you send me sample service application for testing ?
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 98
- Joined: Tue Feb 17, 2009 12:08 pm
Re: pdfSaver4 not disposedof correctly inside a service
Attached is the source code of a sample service.
I'll mention that we are running the service using a user from our domain. Changing the use to the local system user and allowing it to "Interact with desktop" solved the problem (But that's not a good solution for us).
Thanks,
Guy Marom
I'll mention that we are running the service using a user from our domain. Changing the use to the local system user and allowing it to "Interact with desktop" solved the problem (But that's not a good solution for us).
Thanks,
Guy Marom
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 98
- Joined: Tue Feb 17, 2009 12:08 pm
Re: pdfSaver4 not disposedof correctly inside a service
On the same note, is the process pdfSaver necessary if I am not printing batch jobs? And if not, how do I prevent it from being loaded?
-
- Site Admin
- Posts: 3550
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: pdfSaver4 not disposedof correctly inside a service
pdfSaver is required in any case
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 98
- Joined: Tue Feb 17, 2009 12:08 pm
Re: pdfSaver4 not disposedof correctly inside a service
Any news about this?
-
- Site Admin
- Posts: 3550
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: pdfSaver4 not disposedof correctly inside a service
For your info:
Assigning Nothing in .NET doesn't release COM object. To do this, there is method:
System.Runtime.InteropServices.Marshal.ReleaseComObject(spComObj);
Assigning Nothing in .NET doesn't release COM object. To do this, there is method:
System.Runtime.InteropServices.Marshal.ReleaseComObject(spComObj);
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.