Mar 2, 2011 at 5:07 AM
Edited Mar 2, 2011 at 5:08 AM
I Have use this STP in my application for Printing Purpose. What it does is When something is need to be printed it will added to the Thread pool. This dosn't work. My operating system is Windows 7.
When I added to the STP it successfully added and no exceptions. But printing is not working. If I call print method without STP, It prints.
Can any body has such experience ?
public void PrintUsingThreadWithCallerContext(string FileName)
STPStartInfo stpStartInfo = new STPStartInfo();
stpStartInfo.UseCallerCallContext = true;
SmartThreadPool smartThreadPool = new SmartThreadPool(stpStartInfo);
TestPrinter printer = new TestPrinter();
Printing Functions written in a VB.NET library.
' Print the file.
Public Sub Print(ByVal filePath As String)
streamToPrint = New StreamReader(filePath)
printFont = New Font("Arial", 10)
Dim pd As New PrintDocument()
pd.PrinterSettings.PrinterName = "PDFCreator"
AddHandler pd.PrintPage, AddressOf pd_PrintPage
'Print the document.
Catch ex As Exception