G
Guest
I am calling a method like s
System.Threading.Thread myThread =
new System.Threading.Thread(new ThreadStart(CreateTextFile))
myThread.Priority = ThreadPriority.Normal
myThread.Start()
the method creates a simple textfile and then calles another method that opens powerpoin
public void CreateTextFile()//int orderI
///create text fil
string sPath = Server.MapPath(ConfigurationSettings.AppSettings["FileLocation"])
string sFileName = orderId + ".txt"
FileStream fs = File.Create(sPath + sFileName)
StreamWriter sw = new StreamWriter(fs)
for (int i=0; i<MyDataGrid.Items.Count; i++
DataGridItem item = MyDataGrid.Items
System.Web.UI.WebControls.Image img = (System.Web.UI.WebControls.Image)item.FindControl("linkImage")
sw.WriteLine(img.ImageUrl)
}
sw.Close()
///create powerpoint method calle
PPT.GeneratePPT getPPT = new PPT.GeneratePPT()
strPPTfile = PPT.GeneratePPT.CreatePowerPoint(orderId)
the textfile is created fine and powerpoint service gets initiated (i can see it in the task manager) but it never creates the powerpoint. if i call the method directly without using a thread it works fine. i have to use a thread though because some of these powerpoints take minutes to process.
thanks for your help
chris
System.Threading.Thread myThread =
new System.Threading.Thread(new ThreadStart(CreateTextFile))
myThread.Priority = ThreadPriority.Normal
myThread.Start()
the method creates a simple textfile and then calles another method that opens powerpoin
public void CreateTextFile()//int orderI
///create text fil
string sPath = Server.MapPath(ConfigurationSettings.AppSettings["FileLocation"])
string sFileName = orderId + ".txt"
FileStream fs = File.Create(sPath + sFileName)
StreamWriter sw = new StreamWriter(fs)
for (int i=0; i<MyDataGrid.Items.Count; i++
DataGridItem item = MyDataGrid.Items
System.Web.UI.WebControls.Image img = (System.Web.UI.WebControls.Image)item.FindControl("linkImage")
sw.WriteLine(img.ImageUrl)
}
sw.Close()
///create powerpoint method calle
PPT.GeneratePPT getPPT = new PPT.GeneratePPT()
strPPTfile = PPT.GeneratePPT.CreatePowerPoint(orderId)
the textfile is created fine and powerpoint service gets initiated (i can see it in the task manager) but it never creates the powerpoint. if i call the method directly without using a thread it works fine. i have to use a thread though because some of these powerpoints take minutes to process.
thanks for your help
chris